Skip to content

Instantly share code, notes, and snippets.

@cloudchen
Created August 31, 2013 15:09
Show Gist options
  • Save cloudchen/6398811 to your computer and use it in GitHub Desktop.
Save cloudchen/6398811 to your computer and use it in GitHub Desktop.
Disable static file cache for Apache -- Useful for debug environment
<FilesMatch ".(html|htm|js|css|less)$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</FilesMatch>
@cloudchen
Copy link
Author

Suppose that we have 2 virtual hosts in dev environment which are localhost and localhost2.
Only add this configuration to localhost2 host rather general ones.
Access localhost2 for debugging when you don't want meet cache problem which is especially useful for developing with requirejs modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment