Re: Automatic page refresh
by jdhedden (Deacon) on Jul 28, 2005 at 12:09 UTC
|
Since you're using CGI,
when you print out the CGI headers from your script add:
-expires => 'now'
For example:
print(header(-expires => 'now'));
This directive is supposed to cause the browser to expire the page in its cache and get a fresh copy the next time the page is displayed.
Remember: There's always one more bug.
| [reply] [d/l] [select] |
|
|
You shouldn't set the expires header to be "now" (update (thanks frodo72): but that code doesn't set the header to be "now", it is converted to an actual date. That's teach me to not test - you only ever get something wrong if you don't test, 99% of the time, if you do test, your test will give the expected result). The spec says that it must be in HTTP-Date format. It does also say that if a client recieves anything that isn't HTTP-Date, then it should treat it as "already expired" - but intentionally triggering error recovery isn't a fantastic idea.
Other caching headers might also come in useful. Caching Tutorial
for Web Authors and Webmasters is a worthwhile read.
| [reply] |
|
|
| [reply] [d/l] [select] |
|
|
Thanks, folks
This works a treat!
C J
| [reply] |
Re: Automatic page refresh
by anonymized user 468275 (Curate) on Jul 28, 2005 at 11:30 UTC
|
Before assuming this can or should be solved with perl, I would try to eliminate more possibilities, e.g. it could be caused by your hosting provider not giving you access to the real www directory and having a script refreshing the real one.You might also want to provide details such as version of Apache or Netscape server, running on what platform/version etc. etc. to get a reasonable response.
| [reply] |
Re: Automatic page refresh
by blazar (Canon) on Jul 28, 2005 at 11:35 UTC
|
| [reply] [d/l] |
|
|
Ok sorry folks, looks like I wasn't specific enough.
If there's one thing I dislike, it's vagueness...
I am running perl version 5.6.0 on an i386 linux server. My client is running Internet Explorer version 6 on Windows XP. My perl script (sorry for missing out the space last time) does use CGI. Apologies if this sort of thing isn't possibe with Perl, I just thought someone might have known a quick trick.
| [reply] |
Re: Automatic page refresh
by kprasanna_79 (Hermit) on Jul 28, 2005 at 12:34 UTC
|
Hai,
Just try this piece of code in HTMl part..rather than in perl..which save time and code reduction
in header section put this tag
<meta http-equiv= refresh content= 3600 >
-Prasanna.K | [reply] [d/l] |