Skip to content

Instantly share code, notes, and snippets.

@nico-martin
Last active June 13, 2019 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nico-martin/db94f7356eb6438b32a146ae225b118f to your computer and use it in GitHub Desktop.
Save nico-martin/db94f7356eb6438b32a146ae225b118f to your computer and use it in GitHub Desktop.
Cache-Control headers
<ifModule mod_headers.c>
# One year for image and video files
<filesMatch ".(flv|gif|ico|jpg|jpeg|mp4|mpeg|png|svg|swf|webp)$">
Header set Cache-Control "max-age=31536000, public"
</filesMatch>
# One month for JavaScript and PDF files
<filesMatch ".(js|pdf)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>
# One year for CSS files
<filesMatch ".(css)$">
Header set Cache-Control "max-age=31536000, public"
</filesMatch>
</ifModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment