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

Hi,

I'm building an Intranet system with an Admin Panel for users. It is quite annoying when a user logs off and another logs in, because if the latter doesn't hit Refresh/Reload, he/she will probably see a cached page (even though it's a Perl script) from before. I've put the following in the HTML header: <meta http-equiv="Expires" content="Wed, 30 Jul 1997 12:00:00 GMT">, but this doesn't quite make it. Also, I could try adding random gibberish to the query string, so that it doesn't cache, but this looks sort of dirty. Are there any other tricks that I could use instead? Maybe something on the server-side that I can configure?

Thanks,
Ralph.

Replies are listed 'Best First'.
Re: Disable cache of Perl web pages
by iburrell (Chaplain) on Jun 25, 2004 at 16:36 UTC
    Use the Cache-control (for HTTP 1.1) and Pragma (for HTTP 1.0) headers to say the page should not be cached. You can also use the Expires header to say it expires immediately.
    print $cgi->header(-expires => 'now', -Cache_control => 'no-cache', -Pragma => 'no-cache');
Re: Disable cache of Perl web pages
by valdez (Monsignor) on Jun 25, 2004 at 17:34 UTC