» Control cache expire dates using htaccess
If you're running Squid to cache your website, you can use an htaccess file to control what kind of files should be cached, and for how long.
Prerequisites
First you should enable mod_expires, the Apache module that can control the Expire HTTP header in server responses:
a2enmod expires
htaccess
Next create a .htaccess file in your web root, containing:
ExpiresActive On
ExpiresDefault "access plus 4 hours"
ExpiresByType application/javascript A900
ExpiresByType application/x-javascript A900
ExpiresByType text/javascript A900
ExpiresByType text/html A90
ExpiresByType text/xml A90
ExpiresByType text/css A900
ExpiresByType text/plain A62
ExpiresByType image/gif A14400
ExpiresByType image/jpg A14400
ExpiresByType image/jpeg A14400
ExpiresByType image/png A14400
ExpiresByType image/bmp A14400
ExpiresByType application/x-shockwave-flash A3600
And that's it! Play around a bit with the values to suit your needs.
Stay up to date
You can track my blog
articles and
comments. You may also find my
bookmarks interesting. Or
Follow me on Twitter
Like this article?
|
Then Digg it! Or use another bookmark button below to show your support & help me spread the word. |
RelatedArticles like this one» What's the deal with php_value, php_admin_flag, etc |
tags: squid, htaccess, virtual host, apache, mod_expires
category: Howto - Webserver
read: 10,125 times






tagcloud

#2. davarciforum on 14 October 2008
#1. sibirya on 28 August 2008