Last active
May 24, 2017 16:12
-
-
Save RahulSaini91/998ac7751d4eff425dec09c34947a59a to your computer and use it in GitHub Desktop.
Increase the speed of your website by adding apache cache control into your server's htaccess file
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
RewriteEngine on | |
## PLEASE VISIT HERE FOR FULL TUTORIAL / DETAILS OF APACHE htaccess CACHE CONTROL ## | |
## http://www.rahulsaini.co.in/blogs ## | |
## EXPIRES CACHING ## | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
## SET Caching for Images ## | |
ExpiresByType image/jpg "access 1 year" | |
ExpiresByType image/jpeg "access 1 year" | |
ExpiresByType image/gif "access 1 year" | |
ExpiresByType image/png "access 1 year" | |
## SET Caching for CSS ## | |
ExpiresByType text/css "access 1 month" | |
## SET Caching for PDF file ## | |
ExpiresByType application/pdf "access 1 month" | |
## SET Caching for JavaScript file ## | |
ExpiresByType text/x-javascript "access 1 month" | |
## SET Caching for Flash Files ## | |
ExpiresByType application/x-shockwave-flash "access 1 month" | |
## SET Caching for Favicon ## | |
ExpiresByType image/x-icon "access 1 year" | |
ExpiresDefault "access 1 month" | |
</IfModule> | |
## EXPIRES CACHING ## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment