Skip to content

Instantly share code, notes, and snippets.

@codesue
Created December 5, 2017 13:50
Show Gist options
  • Save codesue/498467387c1655c40a9d72637b32a4b6 to your computer and use it in GitHub Desktop.
Save codesue/498467387c1655c40a9d72637b32a4b6 to your computer and use it in GitHub Desktop.
Browser Caching for suzenfylke_com
ErrorDocument 404 /404.html
# 480 weeks
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=290304000, public"
</FilesMatch>
# 2 DAYS
<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</FilesMatch>
# 2 HOURS
<FilesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</FilesMatch>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "public"
Header set Expires "Thu, 27 Dec 2019 20:00:00 GMT"
</FilesMatch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment