PHP not obeying my defined ETags
Posted
by Sam Bisbee
on Stack Overflow
See other posts from Stack Overflow
or by Sam Bisbee
Published on 2010-05-11T00:22:59Z
Indexed on
2010/05/15
1:24 UTC
Read the original article
Hit count: 336
What I'm doing
I'm pulling an image from the database and sending it to the browser with all the proper headers - the image displays fine. I also send an ETag header, using the SHA1 of the image's content as the tag.
The images are getting called semi regularly, so caching is a bit of an issue (won't kill the site, but nice to have).
The Problem
$_SERVER['HTTP_IF_NONE_MATCH'] is not available to me. As far as I can tell, this is because of PHP's "disobey the cache controls" life style. I can't mess with the session cache limiter, because I don't have access. But, even if I did have access, I wouldn't want to touch it: 99% of the site is under WordPress.
The Environment
- PHP 4 (don't ask)
- Apache 2.2
- WordPress
- The images live in the database (largeblog), which I can't change.
Any guidance, tip/tricks, etc. would be helpful. I don't have much room to change the environmental/structural stuff.
Cheers.
© Stack Overflow or respective owner