Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Cache Output HTML

by Anonymous Monk
on Nov 08, 2001 at 23:28 UTC ( [id://124144]=perlquestion: print w/replies, xml ) Need Help??

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

Hi.

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?

Thanks,
Ralph.

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-03-28 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found