I am serving images through php and having some problems setting it up to respond with 304 headers to save on load time.
Most of the code below I found on php.net. I
Check if sessions are being used on that page, If so, try this:
session_cache_limiter(false);
If the above worked, here's the explanation:
Php's session mechanism sends some automatic cache-related headers in order to improve the session cookie privacy, avoiding it to be cached by intermediate proxyes:
http://php.net/manual/en/function.session-cache-limiter.php
These automatic headers cause the browser not to ever send the If-Modified-Since header, as they instruct it to not to perform any caching at all.