Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: web page refreshing problem

by fsn (Friar)
on Feb 09, 2003 at 02:00 UTC ( #233815=note: print w/replies, xml ) Need Help??


in reply to web page refreshing problem

This sounds like a cacheing problem to me. You should tune your webserver to send HTMLheaders with all the correct no-caching -statements for the specific URL, like other suggested.

There is another, sneaky and hacky, way around this which may or may not work. You could reference the image as http://www.theserver.se/pics/theimage.png?a-randomly-generated-string , where http://www.theserver.se/pics/theimage.png is the actual reference, and what's after the ? is a random garbage string, generated differently each access.

Bascially you are sending an argument to the image. Of course, only CGI scripts can have arguments (not really, I think in some cases HTMLpages can take arguments), so the argument is never used (but it's there if you check the environment). But since you generate a new URL each time the cache will miss it and you make sure you get the correct image. To be honest I only tested this with Konqueror, but it works there.

So, now you know the trick. Here's the downside: you will pollute the caches along the way. Now, the cache in your webbrowser, that will only hurt you and your users. But if there are caching proxies between the server and browser, some administrator will get angry as the hitrate declines. Some caches are configured to not cache URLs with ? or cgi-bin in them. You could maybe put them in the garbage string also. Perhaps.

I've told you how you COULD do it, not how you SHOULD do it...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://233815]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2022-11-26 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?