Dynamic Image Header Optimization

  • PolishHurricane
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Feb 17, 2005
  • Posts: 1585
  • Status: Offline

Post March 28th, 2009, 11:28 pm

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?
There's no place like 127.0.0.1, badass part is now it's ::1
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post March 28th, 2009, 11:28 pm

  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8211
  • Loc: USA
  • Status: Offline

Post March 30th, 2009, 3:44 pm

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
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
  • PolishHurricane
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Feb 17, 2005
  • Posts: 1585
  • Status: Offline

Post March 31st, 2009, 3:48 am

Yeah... The other day I just ended up just putting a "Last-Modified" header and left it at that.
There's no place like 127.0.0.1, badass part is now it's ::1
  • Bogey
  • Bogey
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 8211
  • Loc: USA
  • Status: Offline

Post March 31st, 2009, 7:31 pm

Alright... glad you got it figured out :D
"Bring forth therefore fruits meet for repentance:" Matthew 3:8

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 129 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.