Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

How can i do a expires to my page

by Anonymous Monk
on Jun 06, 2001 at 08:46 UTC ( #86114=perlquestion: print w/replies, xml ) Need Help??

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

I'm just new in perl, i wish to know how i can make my page to be expires, i had read the faq in where in the starthtml putting a "Expires" and set the time for the page to be expires. but how is work actually. coz when i click on the back or refresh button the page still refresh. so what can i do. thnak you

Replies are listed 'Best First'.
Re: How can i do a expires to my page
by Chady (Priest) on Jun 06, 2001 at 09:30 UTC

    if you're using expires, then you're doing the right thing... but if the page still shows up when you click back, this is the fault of your ISP probably having a cache that doesn't respect HTML headers..

    and what's with the refresh?? of course you'll see the page when you refresh it.. or do you want everyone to view it only once in their lifetime??

    Maybe the problem is with your code, that's how it should be:

    print $query->header(-type=>'text/html', -expires=>'-1d');

    Update: Re-read it, the expires is in the header not in the starthtml

    He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

    Chady |
Re: How can i do a expires to my page
by tachyon (Chancellor) on Jun 06, 2001 at 16:03 UTC

    Unfortunately not all browsers respect the expires directive, you might try the following to add the no cache pragma to the headers when you output the page you want to expire:


    # if using to generate output try: print $query->header( -type => 'text/html', -expires => '-1d', -Pragma => 'no-cache', -Cache-control => 'no-cache'); # if directly outputing try: print <<END_OF_HEADER; Status: 200 OK Expires: now Pragma: no-cache Cache-control: no-cache Content-type: text/html END_OF_HEADER

    This should generate a page expired message when you try to go back. </code>

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2020-09-23 23:36 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (132 votes). Check out past polls.