NYCPHP Meetup

NYPHP.org

[PHP] Cannot show reuploaded image file on page unless manual refresh

Chris Shiflett shiflett at php.net
Mon Jan 20 17:33:19 EST 2003


--- Phil Powell <soazine at erols.com> wrote:
> Chris, that made no sense to me at all!

Sorry. :-)

> How in the world could an HTTP-RESPONSE send back a
> cached .jpg file that no longer exists on the server
> end? That's impossible, unless the entire page is
> cached. Now, how do I ensure that view.php always
> gets the "fresh" image every time?

I probably explained this poorly. The main point I was
trying to make is that images are completely separate
resources. They are not part of a page as you seem to be
thinking, even though they appear to be once rendered in
your browser.

While a request for view.php results in a response that
includes all of those headers you explicitly set, a request
for blah.jpg gets returned by the Web server directly. It
is probably being cached by the browser.

However, the Web client usually includes an
If-Modified-Since header that will cause the Web server to
return a fresh resource if it has in fact been modified.

Is there a way you can show us the HTTP transactions for
the image in question both before and after it has been
modified?

Chris



More information about the talk mailing list