Using Expire Header to cache images
I am trying to find some info on this. Is this something I should be doing? I have been reading about it, but am not to sure how to implement it.
I'm afraid that I am not entirely sure what you are trying to do. Can you post some links or a code sample?
thanks for the reply... I was reading about Expired Headers and speeding up the load time with my site... I don't quite understand it. So I thought I would ask.
I have done this in my .htaccess file:
ExpiresByType image/gif A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/png A2592000
ExpiresByType text/css A2592000
...but thought I could do that with PHP Headers() somehow. Is that true?
Hmm.. that's a good question. I would assume that you can but have no idea how. I'd like to know myself though so if anyone does know, come post! :-D
If the server doesn't send an Expires header, or one which is really short, then your browser will keep asking to see if it needs to re-download the content (or worse, cache the content however long it feels like) whenever you try to view the page/image/whatever. If the server says, for image.jpg, "Hey this image expires in a week" and you view the image 100 times a day (it's a photo of your new pet, or something) that's lots less downloads than if your browser just grabbed the file every time.
Other helpful headers to look into are
P.S. I'm sure there was an article or two somewhere recently about this, aimed at using these headers specifically with PHP, but I can't remember where it was. :-/
|All times are GMT. The time now is 03:30 AM.|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0