Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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:

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
Node Status?
node history
Node Type: perlquestion [id://124144]
Approved by root
help
Chatterbox?
[Corion]: ambrus: Details ;)
[ambrus]: Like <c>{ package AnyEvent::Impl:: Prima; use Prima; sub io{ my($s,%r)=@_; Prima::File->new( file=>$r{fh},mask =>("w"eq$r{poll}? fe::Write():fe:: Read())|fe:: Exception,onRead =>$r{cb},onWrite =>$r{cb}, onException=>$r{cb }) } sub timer { ... } push @AnyEvent::REGI
[ambrus]: argh, too long, let me try on scratchpad
[Corion]: . o O ( I seem to have improved my skills of getting other people to write code for me )
[ambrus]: ambrus's scratchpad

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2016-12-08 12:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (141 votes). Check out past polls.