I'm experiencing the duplicate CSS issue mentioned in drupal.org #830382: Unwanted / duplicated temporary css files if CSS Optimization is enabled. In one of my production sites I have about 335 CSS files consuming 3.2M. While this is not a big deal at the moment but certainly not saner to let it grow as such. The site is relatively small and using not more than 10 CSS file. The issue link referred above doesn't seem to have any direction. I would like to hear from the experts here to fix it. Thanks in advance.
-
I see similar problem with js files as well.– SivajiFeb 1, 2012 at 8:42
-
1The d.o issue you linked to mentions that the problem likely originated with the ajax_load module, and that module's queue has a few relevant issues. Did you investigate that module and rule it out as the cause?– sheena_dFeb 3, 2012 at 19:14
-
@sheena_d, I don't use ajax_load in my site.– SivajiFeb 4, 2012 at 8:16
-
7I very much doubt you can get anything out of this question without far more context. There are to many different modules that could be involved, and you have told us nothing useful about your setup.– LetharionFeb 4, 2012 at 19:18
-
7When you write that your site has 335 css files, do you mean that there are 335 files ACTIVE? (That is to say, that are served to a web client when a page is accessed?) Or are they simply present in sites/default/files/css?– jmarkelFeb 5, 2012 at 21:51
2 Answers
I think your problem is about aggregate css files. The issue you give is unrelated. Each page may need a different aggregate CSS file (even in D7, it's much better than it was in D6). It results in hundreds of CSS files as you may state.
Nothing to worry about. Unused file will be deleted automatically. I can't suggest you to use Advagg module because it is only for D6 now, but take a look to have an idea about aggregate files actually work (and how they should work).
335 does sound like rather a lot... I wonder if it is a sum of CSS files which have been used?
Try clear your cache to make sure CSS files are being automatically deleted. You should see them all disappear and then gradually be rebuilt as pages are requested which required different CSS files.
If they are not being deleted it might be worth checking file permissions to ensure Drupal has permission to delete them once they are no longer needed.