Wednesday, April 18, 2012

Add expire header to improve the performance of page using .htaccess

I have a great .htaccess code which really improve my page speed.

This one below I below I don't really know much but from looking at it is like to compress or something not really sure

<FilesMatch ".(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE

This one is really great which set the Expire header for everything to 10 years and text/html to one day

ExpiresActive On
ExpiresDefault "access plus 10 years"
ExpiresByType text/html "access plus 1 day"

So This one is use to unset ETag which is one of the requirement rules of YSlow

Header unset ETag
FileETag None

Now come to my question that I have problem with.

I can't really use w3 Total cache with my Wordpress blog because it gives me some random issue like only show one ramdom old post to my home page and to solve that is to delete the cache and then after a day it will happen again.

So I can't rely on that plugin, but with my 3 codes that I added in my .htaccess is really good with one exception and I don't know really how to fix that.

say for example I visit my site this morning and during the day I have 3 new posts. If I don't really do hard reload page I will still see the one from morning.

So this is really make me confuse.

What should I change to not to cache the actual home page so it will be updated except images and the rest.

No comments:

Post a Comment