views:

37

answers:

1

My PHP script depends on being able to read the value of the If-Modified-Since header (yes, I know how to do this).

It worked correctly when I used PHP as mod_php, but now that I've switched to suPHP (CGI), it appears Apache itself handles requests that contain this header, without forwarding them to PHP at all.

This is silly, because Apache can't possibly know when my dynamically generated CSS file (that is what my script makes) is changed. How can I discipline Apache in this regard?

A: 

It's located in the variable $_SERVER['HTTP_IF_MODIFIED_SINCE'].

I use it in a script, along with fun stuff like HTTP_IF_MODIFIED_SINCE. ;-)

Ciao!

The Doctor What
I know that, but Apache does not call PHP at all.
Bart van Heukelom
You mean you get the raw PHP code?
The Doctor What
No, it sends back the output it has in it's own cache.
Bart van Heukelom
"it" being apache? I don't think apache caches things unless you have mod proxy setup. Are you *sure* it isn't caching in the browser? Can you reproduce this behavior using curl or wget?
The Doctor What