Sunday, January 24, 2010

Open expire headers to reduce 304 requests

Open expire headers on Apache http server:

[IfModule mod_expires.c]
ExpiresActive On

ExpiresByType image/* "access plus 30 days"
ExpiresByType application/x-javascript "access plus 30 days"
ExpiresByType text/javascript "access plus 30 days"
ExpiresByType text/css "access plus 30 days"
ExpiresByType image/x-icon "access plus 360 days"

[/IfModule]


before enabling Expire header:


After enabling Expire header:


you can see all of the static files, like images, .js and .css are read from browser cache directly instead of sending additional requests to the server and get 304 not modified response status code. it improves our performance and saving bandwidth as well.

1 comment:

  1. Attractive section of content. I just stumbled upon your website and in
    accession capital to assert that I acquire in fact enjoyed account
    your weblog posts. Any way I'll be subscribing on your augment or even I fulfillment you access constantly quickly.
    Stop by my page instant payday loan

    ReplyDelete