Re: [PHP] New image already cached. (SOLVED)

2006-04-25 Thread Richard Lynch
On Tue, April 25, 2006 8:56 am, tedd wrote: > At 9:56 PM -0500 4/23/06, Richard Lynch wrote: >>On Sun, April 23, 2006 5:25 pm, tedd wrote: >>> >>> >>> Neither the image tag nor the file cares if there is a random >>> number >>> attached to the file's url. But, by doing this, most (perhaps all)

Re: [PHP] New image already cached. (SOLVED)

2006-04-25 Thread tedd
At 9:56 PM -0500 4/23/06, Richard Lynch wrote: On Sun, April 23, 2006 5:25 pm, tedd wrote: Neither the image tag nor the file cares if there is a random number attached to the file's url. But, by doing this, most (perhaps all) browsers think the image name is unique. Doe anyone see any p

Re: [PHP] New image already cached. (SOLVED)

2006-04-23 Thread Richard Lynch
On Sun, April 23, 2006 5:25 pm, tedd wrote: > > > Neither the image tag nor the file cares if there is a random number > attached to the file's url. But, by doing this, most (perhaps all) > browsers think the image name is unique. > > Doe anyone see any problems with this? Oh, all the browsers wi

Re: [PHP] New image already cached. (SOLVED)

2006-04-23 Thread tedd
Richard: Thank you very much for your detailed explanation -- I finally got it. However, the solution to my problem was much easier than I had hoped. My problem was in creating an image on the fly and then using the same file name each time. As such, some browsers cache the image while other

Re: [PHP] New image already cached.

2006-04-20 Thread Richard Lynch
Here's the crucial info you are missing: The URL does not have to *END* in the name of the PHP file. The PHP file could be in the MIDDLE of the URL. In other words, Apache is perfectly happy to take a url like this: http://example.com/program.php/whatever_you-want=to+put_here Example setup:

Re: [PHP] New image already cached.

2006-04-20 Thread Richard Lynch
$image_file = 'foo.jpg'; $random = mt_rand(1, 20); $url = "http://example.com/program/$random/$image_file";; echo " In program, if you echo out $_SERVER['PATHINFO'] you will see: /454398574395/foo.jpg The number will change, of course. You can tear that apart and get the foo.jpg part to

Re: [PHP] New image already cached.

2006-04-19 Thread tedd
You're also better off embedding the parameters in the URL so that it "looks like" a directory to the browser: http://example.com/actual_script/57823642346963/copyright/whatever.png The PHP scritp is actual_script. You can use .htaccess and ForceType to make Apache run it. $_SERVER['PATH_INFO'

Re: [PHP] New image already cached.

2006-04-18 Thread Paul Novitski
At 05:02 PM 4/18/2006, Richard Lynch wrote: If you don't care that some users are not going to see what they need to see on your site, then you just go right ahead and try it with your caching headers. Richard, I'm not suggesting the use of flakey cache control, but rather the use of a differe

Re: [PHP] New image already cached.

2006-04-18 Thread Richard Lynch
On Tue, April 18, 2006 6:39 pm, Paul Novitski wrote: > At 04:12 PM 4/18/2006, Richard Lynch wrote: >>If however, you want to be sure the browser doesn't cache the image, >>because it is dynamic, just add some randomness to the URL. >> >>Technically, that means the browser WILL cache it, but you'll

Re: [PHP] New image already cached.

2006-04-18 Thread Paul Novitski
At 04:12 PM 4/18/2006, Richard Lynch wrote: If however, you want to be sure the browser doesn't cache the image, because it is dynamic, just add some randomness to the URL. Technically, that means the browser WILL cache it, but you'll never use the same URL twice, so you won't really care. Bu

Re: [PHP] New image already cached.

2006-04-18 Thread Richard Lynch
Browsers are not at all reliable about caching (or not) anything other than HTML text in terms of HTTP Headers. Don't waste your time looking for a set of HTTP Headers that will work. I can guarantee *SOME* user out there will have a browser that will do the "Wrong Thing" for any set of headers y

Re: [PHP] New image already cached.

2006-04-18 Thread Paul Novitski
At 03:47 PM 4/18/2006, tedd wrote: Unfortunately, not all browsers treat an image link in the same manner. For example, Safari and FireFox treats the link "/images/merged.png" as a new image every time. Unfortunately, Opera and some other browsers cache the first image and every time after tha

[PHP] New image already cached.

2006-04-18 Thread tedd
Hi gang: I wrote a program that presents a bunch of thumbnails to the users. When the user wants to view a larger version of one of the thumbnails, s/he simply clicks the thumbnail and another page is displayed with the larger image -- nothing new there. However, considering that the larger