Monks ~

Ok, I thought this would be simple, but apparently not. I want to expire pages that my CGI sends to the browser. This is my current code:
print header( -type => 'text/html', -expires => 'now' );
And when called from the shell it prints, as expected:
Expires: Thu, 07 Mar 2002 17:19:12 GMT Date: Thu, 07 Mar 2002 17:19:12 GMT Content-Type: text/html; charset=ISO-8859-1
But when I run the program in a browser, it doesn't at all do what I expect. Now, maybe that's the problem: what I want is for the page to expire and, instead of showing a cached version when the user hits "Back" or "Forward," actually call and run the program again. What the browser (multiple browsers on multiple platforms) does is politely scroll back and forth through its history.

I've tried setting "-expires" to "-1d", and leaving it out entirely, with the same (zero) effect. There are other ways I can solve this problem, but cache-control seems one of the better ones. Any advice from the Monks on how to get this working?

Thanks!
--
man with no legs, inc.

In reply to Expiring CGI pages by legLess

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.