Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

IE cgi caching

by Anonymous Monk
on Aug 15, 2005 at 19:23 UTC ( #483958=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to prevent IE from caching my CGI program. Right now I'm using the standard methods in CGI. I've tried the following:
print header(-expires=>'-1d');
<META http-equiv="Expires" content=" Thu, 25 Jul 2002 08:12:13 GMT">
<META http-equiv="Pragma" content="no-cache">
Can anyone help?

Replies are listed 'Best First'.
Re: IE cgi caching
by !1 (Hermit) on Aug 15, 2005 at 19:32 UTC
    This will probably help.
Re: IE cgi caching
by gryphon (Abbot) on Aug 16, 2005 at 02:10 UTC

    Greetings Anonymous Monk,

    What !1 referenced looks very cool and is a much better option than my idea, but for completeness: What has worked for me in the past is to specify some throw-away query parameter that is always changing. For example:

    my $url = 'yourscript.cgi?data=realdata&ignore=' . time . rand # Then feed $url to links in refering pages

    Every time you click a link from a refering page (which itself has to be a script because it generates the random URL), you get a new unique URL for which IE has no cache. Just ignore the ignore parameter. It's hokey; it's stupid; it's a hack, but it has the value of working.

    gryphon Development Manager (DSMS)
    code('Perl') || die;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://483958]
Approved by sgifford
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2020-11-30 23:11 GMT
Find Nodes?
    Voting Booth?

    No recent polls found