top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Enabling caching for a Website using htaccess

0 votes
345 views

Every website wants to enable the caching so that site is loaded faster and saves the bandwidth. Following is the code which can be added to the .htaccess file (with apache).

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
<FilesMatch "\.(ico|jpg|jpeg|png|gif)$">
ExpiresDefault "access plus 2 weeks"
</FilesMatch>
<FilesMatch "\.(js|css|swf)$">
ExpiresDefault "access plus 2 weeks"
</FilesMatch>
</IfModule>
## EXPIRES CACHING ##

Possible values of ExpiresDefault

ExpiresDefault "access plus 1 month"
ExpiresDefault "access plus 4 weeks"
ExpiresDefault "access plus 30 days"

Note: Above code is running at QueryHome.

posted Jun 12, 2014 by Salil Agrawal

  Promote This Article
Facebook Share Button Twitter Share Button LinkedIn Share Button

...