Skip to content

Instantly share code, notes, and snippets.

@JamieMason
Created August 3, 2012 07:40
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamieMason/3245483 to your computer and use it in GitHub Desktop.
Save JamieMason/3245483 to your computer and use it in GitHub Desktop.
Apache .conf to disable caching for localhost
<Directory "/Users/jdog/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Users/jdog/Sites/
# PROXIES
# ProxyPass /local/path http://some.com/remote/path
# DISABLE ALL CACHING WHILE DEVELOPING
<FilesMatch "\.(html|htm|js|css|json)$">
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 Note "CACHING IS DISABLED ON LOCALHOST"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</IfModule>
</FilesMatch>
</VirtualHost>
@JamieMason
Copy link
Author

There should be a file at /private/etc/apache2/users/YOUR_USER_NAME.conf to edit

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