[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Wed, 06 Oct 2004 18:54:32 -0000
albertel Wed Oct 6 14:54:32 2004 EDT
Modified files:
/loncom/interface loncommon.pm
Log:
- reenable the Expires cache header in order to make more caches listen to us
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.215 loncom/interface/loncommon.pm:1.216
--- loncom/interface/loncommon.pm:1.215 Wed Sep 29 15:13:20 2004
+++ loncom/interface/loncommon.pm Wed Oct 6 14:54:32 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.215 2004/09/29 19:13:20 albertel Exp $
+# $Id: loncommon.pm,v 1.216 2004/10/06 18:54:32 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2747,12 +2747,12 @@
=cut
sub cacheheader {
- unless ($ENV{'request.method'} eq 'GET') { return ''; }
- my $date=strftime("%a, %d %b %Y %H:%M:%S GMT",gmtime);
- my $output .='<meta HTTP-EQUIV="Expires" CONTENT="'.$date.'" />
+ unless ($ENV{'request.method'} eq 'GET') { return ''; }
+ my $date=strftime("%a, %d %b %Y %H:%M:%S GMT",gmtime);
+ my $output .='<meta HTTP-EQUIV="Expires" CONTENT="'.$date.'" />
<meta HTTP-EQUIV="Cache-control" CONTENT="no-cache" />
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache" />';
- return $output;
+ return $output;
}
=pod
@@ -2764,12 +2764,13 @@
=cut
sub no_cache {
- my ($r) = @_;
- unless ($ENV{'request.method'} eq 'GET') { return ''; }
- #my $date=strftime("%a, %d %b %Y %H:%M:%S GMT",gmtime);
- $r->no_cache(1);
- $r->header_out("Pragma" => "no-cache");
- #$r->header_out("Expires" => $date);
+ my ($r) = @_;
+ if ($ENV{'REQUEST_METHOD'} ne 'GET' &&
+ $ENV{'request.method'} ne 'GET') { return ''; }
+ my $date=strftime("%a, %d %b %Y %H:%M:%S GMT",gmtime(time));
+ $r->no_cache(1);
+ $r->header_out("Expires" => $date);
+ $r->header_out("Pragma" => "no-cache");
}
sub content_type {