Web accelerator problems

I noticed that the cache hits on the assets server were pretty low and as a result we were getting about 30 hits per second for images on the main applications server (what’s supposed to happen is that although the images start out on the applications server they should all end up cached on the assets server which acts as a web accelerator resulting in virtually no image hits on the apps server).

It turns out that somehow I’d messed up the Cache-Control headers so they were missing which I guess made the cache virtually useless. My problem was that I’d forgotten the ‘ExpiresActive on’ directive which resulted in all my ExpiresByType directives failing silently.

Note to self: lynx -head http://www.fabswingers.com/ is a great way to verify that the headers are correct.

While I was at it, I also adjusted the settings for mod_deflate to make sure that all the right pages were being zipped. On Debian, the default is:

AddOutputFilterByType DEFLATE text/html text/plain text/xml

Which I changed to:

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css

So my (fairly lengthy) stylesheets are now compressed too, which should make a fractional difference to speed and bandwidth.

Leave a Reply

You must be logged in to post a comment.