Re: [PHP] Is it possible to stop an image from being cached?

2007-07-27 Thread Richard Heyes
Dan wrote: ... You should also look at this: http://www.mnot.net/cache_docs/ Very informative. -- Richard Heyes +44 (0)844 801 1072 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing List

RE: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Chris Aitken
Solution 1: Send a header() that avoids caching (can't remember it exactly) Solution 2: Call the image like this: img src=image.jpg?arandomstringhereeachtime Or if you were creating it with a php script: img src=image.php?img=image.jpgarandomstringhereeachtime My preferred way of doing it,

Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread brian
Tijnema wrote: On 7/26/07, Dan [EMAIL PROTECTED] wrote: I have a situation where there is a single image let's call it somebody.jpg. I want to be able to dynamicly create this image using php, basicilly I have PHP set to handle .jpg files also, so I then go through and create an image based

Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Dan
Well, this is only one specific image that constantly changes, the rest of the page is handled regularly. From what you've said if I go with this header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past That will effect

Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Dan
Is this header you're refering to the header of the page which contains the image, or the image itself? - Dan Tijnema [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 7/27/07, brian [EMAIL PROTECTED] wrote: Tijnema wrote: On 7/26/07, Dan [EMAIL PROTECTED] wrote: I have a

Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Tijnema
On 7/27/07, Chris Aitken [EMAIL PROTECTED] wrote: header('Cache-Control: no-store, no-cache, must-revalidate, Post-Check=0, Pre-Check=0'); brian That's HTTP/1.1 only, but this is what I got from PHP site: ?php header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires:

[PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Dan
I have a situation where there is a single image let's call it somebody.jpg. I want to be able to dynamicly create this image using php, basicilly I have PHP set to handle .jpg files also, so I then go through and create an image based upon some info I get from a database call and then use

Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Tijnema
On 7/26/07, Dan [EMAIL PROTECTED] wrote: I have a situation where there is a single image let's call it somebody.jpg. I want to be able to dynamicly create this image using php, basicilly I have PHP set to handle .jpg files also, so I then go through and create an image based upon some info I

Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Dan
Awesome, seems to work. Thanks Tijnema! - Dan Dan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Well, this is only one specific image that constantly changes, the rest of the page is handled regularly. From what you've said if I go with this header(Cache-Control: no-cache,

Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Tijnema
On 7/27/07, Dan [EMAIL PROTECTED] wrote: Is this header you're refering to the header of the page which contains the image, or the image itself? - Dan The image itself. Also note, that if you use my solution 2, you still might get problems, as the page that is calling might be cached, and in

Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Tijnema
On 7/27/07, brian [EMAIL PROTECTED] wrote: Tijnema wrote: On 7/26/07, Dan [EMAIL PROTECTED] wrote: I have a situation where there is a single image let's call it somebody.jpg. I want to be able to dynamicly create this image using php, basicilly I have PHP set to handle .jpg files also,

Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Richard Lynch
On Thu, July 26, 2007 6:32 pm, Tijnema wrote: Also, if you use solution 2, the image will still stay forever in the Not forever. Just until something else being downloaded shoves it out due to the folder size restriction. The browser might even be smart and keep oft-used resources in the cache

Re: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Richard Lynch
On Thu, July 26, 2007 4:56 pm, Dan wrote: Is there any tactic short of changing the name constantly of the image to avoid browser caching of an image? You can try to use all the zillion header calls people will send you. Somewhere out there is a really stupid browser that will insist on

RE: [PHP] Is it possible to stop an image from being cached?

2007-07-26 Thread Chris Aitken
header('Cache-Control: no-store, no-cache, must-revalidate, Post-Check=0, Pre-Check=0'); brian That's HTTP/1.1 only, but this is what I got from PHP site: ?php header(Cache-Control: no-cache, must-revalidate); // HTTP/1.1 header(Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past ?