Created
February 26, 2010 14:43
-
-
Save skojin/315760 to your computer and use it in GitHub Desktop.
set expire header for images/assets that have version info in query string, apache conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mark versioned assets | |
RewriteCond %{REQUEST_URI} ^/(images|stylesheets|javascripts)/.*\.(css|js|jpe?g|png|gif|ico)$ | |
RewriteCond %{QUERY_STRING} ^[0-9]+$ | |
RewriteRule ^.*$ $0 [E=IS_VERSIONED_ASSET:true,L] | |
# expire them in future | |
Header onsuccess set "Cache-Control" "max-age=31536000" env=IS_VERSIONED_ASSET |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment