Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Expires Headers?


Stealth1

Recommended Posts

I have just been playing with some things trying to improve my site and stumbled upon the YSlow add-on for firefox. It is saying that pretty much all of the images, the stylesheet and a couple other things have "no expires" and setting expires would reduce page load times. I was wondering how I can implement this to certain elements or is it something that can only be completely on or off?

Link to comment
Share on other sites

Apparently that means that the browser must check each and every HTML page, image, stylesheet, etc. at each display, to see if anything is newer and needs reloading (as opposed to using what's in the cache). I don't think that means reloading everything each time (ignoring browser cache), but still, the process of checking each page item costs time. I googled for http expires header, and came up with this interesting article from Yahoo: http://developer.yahoo.com/performance/rules.html . You want to be careful about marking anything as expiring far in the future, as that means that your old, cached copy will be used for a long time. In a store with constantly changing pages, this would be a problem. You might be able to mark some items that have a unique name as not expiring for a while (cache-control), saving check and reload times.

 

Unfortunately, if osC is not currently structured to send "expires" or "cache-control" headers with various files, I suspect it would be a major undertaking to add it. You can't do it haphazardly, or you'll end up with pages "frozen" for a long time. Not having experience in that particular area, I will turn over the soap box to anyone who can speak authoritatively on that subject. Personally, for a dynamic and constantly changing store, I wouldn't worry about trying to do this stuff. It's probably more useful on sites (or pages within a site) that change very slowly (are largely static).

Link to comment
Share on other sites

Thanks for the reply Phil, I found the same article and info as you when I first looked into it. From he scan that Yslow did it basically said that on each page it was reloading the Godaddy SSL flash file. If I could cache this that would be great. I agree that trying to do this for a whole site would be a bad idea and it would make it more work to update a picture in the future.

 

I was mainly thinking of the Godaddy thing in my specific case, some of the image files used in the layout and maybe the stylesheet

 

Hopefully someone may have done this previously

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...