Dynamic Image Header Optimization

  • PolishHurricane
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1585

Post 3+ Months Ago

I have a PHP file that displays images that are stored in my database. I'm trying to optimize my website by sending certain headers to the browser that say how long before expiration or when it expires.

I don't want to just use "Cache-Control: max-age" with some time that I estimated the images would expire, because they could either change in 5 months or 1 second from now. But is that the only thing I can do? For each image, I can also get the timestamp of when it was added if that helps at all. What headers would be best to send to the browser?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

See if any of these articles help you:

http://devreview.com/php-image-output-a ... r-caching/
http://drupal.org/node/25977
http://www.dynamicdrive.com/forums/arch ... -3685.html
http://www.htaccesselite.com/using-php- ... vt156.html
  • PolishHurricane
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1585

Post 3+ Months Ago

Yeah... The other day I just ended up just putting a "Last-Modified" header and left it at that.
  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

Alright... glad you got it figured out :D

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 96 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.