[Gllug] Perl question, but it is a linux server!

Richard W.M. Jones rich at annexia.org
Thu Mar 27 18:32:37 UTC 2003


> On Thu, 27 Mar 2003, Adrian McMenamin wrote:
> 
> > I would like to put 'no cache' in the headers for a page generated by perl
> > and I am not using the CGI module.
> > 
> > Googling has produced lots of evil :-> python code, but none in lovely perl.

# Aggressively defeat caching for CGI script responses.
sub _defeat_caching
  {
    print "Cache-Control: must-revalidate\n";
    print "Expires: Thu, 01 Dec 1994 16:00:00 GMT\n";
    print "Pragma: no-cache\n";
  }

# If the "cache => 1" option is set, send distant Expires headers.
sub _allow_caching
  {
    print "Expires: Sun, 01 Dec 2030 16:00:00 GMT\n";
  }


-- 
Richard Jones, Red Hat Inc. (London office, UK) http://www.redhat.com/
http://www.annexia.org/ Freshmeat projects: http://freshmeat.net/users/rwmj
MONOLITH is an advanced framework for writing web applications in C, easier
than using Perl & Java, much faster and smaller, reusable widget-based arch,
database-backed, discussion, chat, calendaring:
http://www.annexia.org/freeware/monolith/

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list