Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Cache Output HTML

by Anonymous Monk
on Nov 08, 2001 at 23:28 UTC ( #124144=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:


What is the header that should go along with print "Content-type: text/html\n\n"; that will force the browser to cache the html outputted by a cgi script?


Replies are listed 'Best First'.
Re: Cache Output HTML
by Asim (Hermit) on Nov 08, 2001 at 23:47 UTC

    As a rule, you can recommend, not force, a browser to cache, or not cache, a page. Most browsers will listen to the "Expires" Header:
    Expires: Fri, 30 Oct 1998 14:19:41 GMT
    And the more recent (HTTP 1.1) "Cache-Control" Header:
    Cache-Control: max-age=3600, must-revalidate
    To sort these things out. Check out How (and how not) to Control Caches for more on this.

    ----Asim, known to some as Woodrow.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2016-10-23 08:25 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (300 votes). Check out past polls.