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.