Jump to content
  • Advertisement
Sign in to follow this  
ID Merlin

[web] HTTP caching and PHP

This topic is 3701 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a PHP script that generates images. I don't think I'm defining the headers correctly to tell the browser to cache these, as they will rarely, if ever, change. I'm trying to set the expiration of the cache to 10 days, using this header: header("Cache-Control: max-age=864000");. I'm guessing that I need something else, or something additional, to get this to work consistently cross-browser. edit: I just thought of another bit of information that may make a difference in the answer: The image tags are generated by javascript on the client-side, which reduces the size of the page load. I wonder if this is the cause of the non-caching behavior? Any help would be appreciated. Thanks. [Edited by - ID Merlin on October 26, 2008 4:15:02 PM]

Share this post


Link to post
Share on other sites
Advertisement
I think you need at least the Cache-Control and Expire headers. And maybe the Last-Modified and Content-Length headers, but I'm not sure about those. Check this page and experiment with the different headers mentioned.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!