Drupal Boost Module Caches CSS: Can't Change File After Boost Uninstall

Jeremy John's picture

So when working with a dev site, I couldn't figure out why my changes to CSS weren't propagating.

I turned off the boost module, cleared the cache, restarted apache.

Then I realized that Apache must be actually not getting to the file. And the only place to do that in Drupal is the .htaccess file.

Viola! Remove this from your .htaccess:

  1. ### BOOST START ###
  2. AddDefaultCharset utf-8
  3. <FilesMatch "(\.html|\.html\.gz)$">
  4. <IfModule mod_headers.c>
  5. Header set Expires "Sun, 19 Nov 1978 05:00:00 GMT"
  6. Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
  7. </IfModule>
  8. </FilesMatch>
  9. <IfModule mod_mime.c>
  10. AddCharset utf-8 .html
  11. AddCharset utf-8 .css
  12. AddCharset utf-8 .js
  13. AddEncoding gzip .gz
  14. </IfModule>
  15. <FilesMatch "(\.html|\.html\.gz)$">
  16. ForceType text/html
  17. </FilesMatch>
  18. <FilesMatch "(\.js|\.js\.gz)$">
  19. ForceType text/javascript
  20. </FilesMatch>
  21. <FilesMatch "(\.css|\.css\.gz)$">
  22. ForceType text/css
  23. </FilesMatch>
  24.  
  25. # Gzip Cookie Test
  26. RewriteRule boost-gzip-cookie-test\.html cache/perm/boost-gzip-cookie-test\.html\.gz [L,T=text/html]
  27.  
  28. # GZIP - Cached css & js files
  29. RewriteCond %{HTTP_COOKIE} !(boost-gzip)
  30. RewriteCond %{HTTP:Accept-encoding} !gzip
  31. RewriteRule .* - [S=2]
  32. RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css\.gz -s
  33. RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css\.gz [L,QSA,T=text/css]
  34. RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js\.gz -s
  35. RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js\.gz [L,QSA,T=text/javascript]
  36.  
  37. # NORMAL - Cached css & js files
  38. RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css -s
  39. RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.css [L,QSA,T=text/css]
  40. RewriteCond %{DOCUMENT_ROOT}/cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js -s
  41. RewriteRule .* cache/perm/%{SERVER_NAME}%{REQUEST_URI}_\.js [L,QSA,T=text/javascript]
  42.  
  43. # Caching for anonymous users
  44. # Skip boost IF not get request OR uri has wrong dir OR cookie is set OR request came from this server OR https request
  45. RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [OR]
  46. RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|openid|themes|node/add))|(/(comment/reply|edit|user|user/(login|password|register))$) [OR]
  47. RewriteCond %{HTTP_COOKIE} DRUPAL_UID [OR]
  48. RewriteCond %{HTTP:Pragma} no-cache [OR]
  49. RewriteCond %{HTTP:Cache-Control} no-cache [OR]
  50. RewriteCond %{HTTPS} on
  51. RewriteRule .* - [S=3]
  52.  
  53.  
  54. # GZIP
  55. RewriteCond %{HTTP_COOKIE} !(boost-gzip)
  56. RewriteCond %{HTTP:Accept-encoding} !gzip
  57. RewriteRule .* - [S=1]
  58. RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz -s
  59. RewriteRule .* cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html\.gz [L,T=text/html]
  60.  
  61. # NORMAL
  62. RewriteCond %{DOCUMENT_ROOT}/cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html -s
  63. RewriteRule .* cache/normal/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}\.html [L,T=text/html]
  64.  
  65. ### BOOST END ###

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockcode>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <blockcode>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
Are you a robot? We usually like robots, but not in our comments.
By submitting this form, you accept the Mollom privacy policy.