Skip to content

Commit

Permalink
Mofify cache control:
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavk96 committed Feb 18, 2018
1 parent 357885d commit 2d1b89a
Showing 1 changed file with 35 additions and 16 deletions.
51 changes: 35 additions & 16 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##
<IfModule mod_headers.c>
Header set Connection keep-alive

# Cache-control headers
# 2 HOURS
#<filesMatch "*">
Header set Cache-Control "max-age=7200, must-revalidate"
#</filesMatch>

# 480 weeks - 290304000
# 2 WEEKS
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|swf)$">
Header set Cache-Control "max-age=1209600, public"
</filesMatch>

# 1 DAY
<filesMatch "\.(css)$">
Header set Cache-Control "max-age=86400, public, must-revalidate"
#Header set Cache-Control "max-age=0, public, must-revalidate"
</filesMatch>

# 2 DAYS
<filesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
</filesMatch>

# 2 HOURS
<filesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</filesMatch>

<FilesMatch "\.(gif|jpg|png|ico|css|js|pdf|txt)$">
Header append Cache-Control "public"
</FilesMatch>
</IfModule>

0 comments on commit 2d1b89a

Please sign in to comment.