You are here: Re: HTML problem with refreshing the browser's display of an image « HTML « IT news, forums, messages
Re: HTML problem with refreshing the browser's display of an image

Posted by Edward Diener on 01/26/08 10:39

Jonathan N. Little wrote:
> Edward Diener wrote:
>> Neredbojias wrote:
>>> Well bust mah britches and call me cheeky, on Fri, 25 Jan 2008
>>> 18:20:08 GMT Edward Diener scribed:
>>>
>>>> I am working on a web application which programatically changes an
>>>> image on the server side ( via ImageMagick ) on the roundtrip
>>>> between client and server. When the web page, in which the img tag
>>>> resides, is redisplayed, I need Firefox to reread the web page in
>>>> order to redisplay the image correctly rather than take the image
>>>> from its cache.
>>>
>>> What is the filename of your page? Is the extension .php?
>>>
>>> Test: try using sessions.
>>>
>>
>> Meaningless !
>
>
> Serve image with PHP and use header() function
>
> <?php
> $theImage=[whatever the URL or filespec to your image];
> $image=file_get_contents($theImage);
>
> header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1

These are in my OP.

> header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past

In my OP I have "Expires: -1". Is that invalid for setting an expiration
date in the past ?

> header("Content-type: image/jpg"); //whatever image type is...

In my OP I am serving a web page, on which the image resides, so I have:

Content-type: text/html

> echo $image;
> ?>

Thanks, but I am not programming the page using PHP ( I am using C++
instead ). I am, however, programatically setting the content header
cache control and expires values to what was specified in my OP.
Nonetheless the browser is ignoring the cache-control values and
grabbing the image from its cache.

I will try specifically setting the Expires value to a value like you
have above and seeing if that fixes the problem. Perhaps "Expires: -1"
is not valid. That is what the legacy code with which I am working had,
so perhaps it is incorrect.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация