Skip to content

Instantly share code, notes, and snippets.

@ruckus
Created July 1, 2010 21:02
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 ruckus/460556 to your computer and use it in GitHub Desktop.
Save ruckus/460556 to your computer and use it in GitHub Desktop.
<LocationMatch "\/(images)\/.*\.(ico|pdf|flv|jpe?g|png|gif|js|css|swf)">
# Set far future expires
RewriteEngine on
RewriteCond %{REQUEST_URI} \.(css|js|jpe?g|png|gif|ico) [NC]
RewriteCond %{QUERY_STRING} [0-9]+$
RewriteRule ^(.*)$ $1 [E=VERSIONED_FILE:1,L]
Header add "Expires" "Mon, 28 Jul 2014 23:30:00 GMT" env=VERSIONED_FILE
Header add "Cache-Control" "max-age=315360000" env=VERSIONED_FILE
Header unset ETag
FileETag None
</Location>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment