Created
July 23, 2014 20:04
-
-
Save kingharrison/5b30de11e4865e995401 to your computer and use it in GitHub Desktop.
Caching Images and CSS on an IBM i running apache to speed up access
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
<ifModule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault "access plus 1 seconds" | |
ExpiresByType text/html "access plus 1 seconds" | |
ExpiresByType image/gif "access plus 2592000 seconds" | |
ExpiresByType image/jpeg "access plus 2592000 seconds" | |
ExpiresByType image/png "access plus 2592000 seconds" | |
ExpiresByType text/css "access plus 604800 seconds" | |
ExpiresByType text/javascript "access plus 216000 seconds" | |
ExpiresByType application/x-javascript "access plus 216000 seconds" | |
</ifModule> | |
<ifModule mod_headers.c> | |
<filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$"> | |
Header set Cache-Control "max-age=2592000, public" | |
</filesMatch> | |
<filesMatch "\\.(css)$"> | |
Header set Cache-Control "max-age=604800, public" | |
</filesMatch> | |
<filesMatch "\\.(js)$"> | |
Header set Cache-Control "max-age=216000, private" | |
</filesMatch> | |
<filesMatch "\\.(xml|txt)$"> | |
Header set Cache-Control "max-age=216000, public, must-revalidate" | |
</filesMatch> | |
<filesMatch "\\.(html|htm|php)$"> | |
Header set Cache-Control "max-age=1, private, must-revalidate" | |
</filesMatch> | |
</ifModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment