NYCPHP Meetup

NYPHP.org

[nycphp-talk] Cannot show reuploaded image file on page unless manual refresh

Phil Powell soazine at erols.com
Mon Jan 20 19:01:26 EST 2003


HTTP protocol is far beyond me, I'm sorry.

What I did in view.php is simple: I am now generating a random string inside
the image URL, so that when you upload an image you get something like this:

Kd0SLDSdslasdfasdOWKDC_60.jpg

the first part of the URL is a random string that causes a fresh new URL to
appear everytime you upload a new image and then go to view.php.  I figured
that was the best way of handling the image URL caching issue, since HTTP
protocols are honestly out of my league.

Phil
----- Original Message -----
From: "George Webb" <gw.nyphp at gwprogramming.com>
To: "NYPHP Talk" <talk at nyphp.org>
Sent: Monday, January 20, 2003 6:49 PM
Subject: Re: [nycphp-talk] Cannot show reuploaded image file on page unless
manual refresh


> Phil, I'm sure we can see the problem by looking just at the client-side,
> since it sounds like an HTTP issue.  But could you show us the rest of
> the source for view.php?
>
> Specifically, does view.php actually print out an image, i.e.
> does it set Header ( 'Content-type: image/jpeg' ) or other image type?
>
> Or does it then do another redirect (e.g.
> Header ( 'Location: /other/path/imageNNN.jpg' )?
>
> If it's the latter, your no-cache magic won't apply.  You have
> to do the former, or find some other way to set the no-cache stuff
> for the images.  (In that case I think Apache has a directive or two
> you can use to force no-cache.)
>
> Of course, if these images are to get repeatedly hit by the
> same client, you waste bandwidth and CPU time if you keep sending the
> same image (i.e. defeating the cache).  So you should harness the HTTP
> caching protocol prudently.
>
>
> Best, George.
>
> George Webb
>
>
> --- Unsubscribe at http://nyphp.org/list/ ---
>
>




More information about the talk mailing list