You are here
Home ›Quickly Disable Drupal CSS Caching with Drush
A quick note on how to disable CSS caching with Drush.
While I’m developing a theme, I usually leave CSS caching off so I can make changes and see the result straight away. Once the site is deployed however, I usually pull back an exact copy of the production website before I do any maintenance, including the settings from the database (for small sites without sensitive data anyway). This includes the settings that turn on CSS and page caching. So it typically happens that I will start updating the sites’ CSS, notice that my changes weren’t showing up, and quickly work out that CSS caching was still turned on.
I eventually got sick of having to log into the site, navigate to the performance page, turn CSS caching off, wait for the page to refresh… and so on, before I could see the CSS changes. So, I worked out how to do it from the command line:
drush vset preprocess_css 0 --yes
And if you just want to clear the CSS cache for one shot:
drush cc css+js
I hope that comes in handy for someone.



Comments
Nice. Have you found a similar way to disable javascript optimization?
Sure, you can disable JavaScript optimization using the same method:
Awesome, thank you!
You can get even more lazy (er, "efficient") with:
(Hey, seriously, that's three fewer keystrokes.)
Add new comment