[Zope] Browser Sticky Fingers

Robin Becker robin@jessikat.demon.co.uk
Wed, 20 Oct 1999 11:27:30 +0100


In article <199910182316.JAA00991@mbuna.arbhome.com.au>, Anthony Baxter
<anthony@interlink.com.au> writes
>
>>>> "Jeff Rush" wrote
>> I'm pulling my hair out here over what is probably a simple HTTP issue.
>> I have a Zope method that stuffs a new image into a Zope Image object,
>> based on the content of the page where the method is called.
>> 
>> The problem is that the image is not updated until I exit the browser,
>> and then flush all of it's caches manually.
>> 
>> I've turned off any proxy support, configured Netscape 4.x with the
>[...]
>
>> Am I missing something simple?
>
>Yep. Browsers suck. They cache images regardless. The disgusting 
>hack is to always call your image with the current time in the URL -
>eg. <img src="/your/image/method?dummy_ts=<dtml-var "ZopeTime().timeTime()">">
>/your/image/method should feel entirely free to ignore dummy_ts.
>
>This way the image has a different URL, and so the browser doesn't
>use a cached one.
>
>When you're producing on-the-fly live statistics as a graph, this 
>hideous misfeature is a complete pain in the clacker.
>
>Anthony
I tried to do image reloads with javascript and it doesn't work (it's
the URL that's cached). Seems that some of the surfcam sites use some
kind of java to do this and it seems to work. Real overkill though so
I've reverted to adding a spurious ?timestring as a cache fooler. Causes
the browser to fill up memory and disk caches.
-- 
Robin Becker