3

I'm using D7, recently I checked all the bandwidth optimization option in admin/config/development/performance, I wanted some change-back in CSS afterwards, which now I can't with the bandwidth optimization being checked. I tried unchecking that bandwidth optimization, then it accepts the new change. But when I check the bandwidth optimization again, it takes me to an older version of CSS, Please let me know how to update the CSS as well as checking all the optimized radio buttons.

  • I'm having the same error as you, but did a little more testing. The issue seems to be that clearing caches via drupal or via drush does not update the aggregated css files in /files/css. Struggling to find a solution here. – marblegravy Jul 19 '13 at 0:39
  • Standard development practices are that you always keep css/js aggregation disabled till you are done with all css and js changes on your test environment. You should disable css/js aggregation and then clear caches in all ways and try again. You should be fine after this. Make all your changes and enable aggregation only when you are finally done. – user1153986 Sep 4 '13 at 5:39
2

CSS/JS aggregation's purpose is to bundle all your non-external css/js files into a single file. This way instead of requesting multiple files and requiring multiple connections with the server, the client only has to download the unified css/js file once. However, this specific file is not re-created every time you make a change to your css or javascript. You will have to manually do it. Here is how:

In Drupal 7 go to: Administration > Configuration > Development > Performance (admin/config/development/performance)

and click the "Clear all caches" button. Notice that this will clear all caches of your site.

The method that I use more often though is to clear all the caches through Drush (if you do not know what Drush is, you should really check it out since it's a real life saver). Instead of navigating to the URL and clicking the button, you can just write the simple command:

drush cc all

in your command line and all caches will be cleared.

Keep in mind, that if you are still theming/developing your site, you should disable CSS/JS aggregation. If you don't, you are adding more workload to the server that is rebuilding the unified css/js files every time that you press the "Clear All Caches" button. The specific option should only be turned on on production sites where css/js files have been finalized.

  • My issue is that clearing caches via drupal or via drush does not update the aggregated css files in /files/css, so this solution (as correct as it should be) isn't working in my case. – marblegravy Jul 19 '13 at 0:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.