httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk-Willem van Gulik <di...@elect6.jrc.it>
Subject Expirey in bugdb.
Date Fri, 14 Nov 1997 10:53:01 GMT

Hmm, anyone object in a bit of Expiry in bugdb.cgi; just so
one does not have to wait 15 minutes for a page to come across
each time you rescale the window or use the back window.

Dw.


Index: bugdb.cgi
===================================================================
RCS file: /usr/home/dirkx/supped/apache-site/bugdb.cgi,v
retrieving revision 1.20
diff -u -r1.20 bugdb.cgi
--- bugdb.cgi   1997/11/13 21:56:39     1.20
+++ bugdb.cgi   1997/11/14 12:47:09
@@ -16,6 +16,12 @@
 $DATEPROG    = "/bin/date";
 $LSPROG      = "/bin/ls";
 $GNUINFOSCRIPT = "http://www.hyperreal.org/info/gnuinfo/index";
+
+# Lifetime for the output; as I hate to reload each time all
+# the way across the atlantic whenever one resizes the window...
+$life_time = 30*60; # Seconds.  (dirkx)
+
+
 ### Configuration ends here
 
 ### Modification log:
@@ -233,8 +239,20 @@
     print "</pre>\n";
 }
 
+sub RFC {
+        local (@time)=gmtime(shift(@_));
+        local (@mon)=('Jan', 'Feb', 'Mar' ,'Apr', 'May' ,'Jun' ,'Jul' ,
+                      'Aug' ,'Sep' ,'Oct' ,'Nov' ,'Dec');
+        local (@wdy)=('Sun', 'Mon', 'Tue', 'Wed', 'Thu','Fri', 'Sat');
+ 
+        return sprintf(
+        "$wdy[$time[6]], %02d $mon[$time[4]] $time[5] %02d:%02d:%02d
GMT",
+                $time[3],$time[2],$time[1],$time[0]);
+        };
+
 #
-# Emits either a rredirect or the preamble to some HTML.
+# Emits either a redirect or the preamble to some HTML.
 #
 sub emit_preamble {
     local ($redirect, $target, $oldsel) = @_;
@@ -244,6 +262,7 @@
     if ($redirect) {
        print "Location: $target\n\n";
     } else {
+       print "Expires: ".&RFC( time + $life_time )."\n";
        print "Content-type: text/html\n\n";
        print "<HTML>\n";
     }



Mime
View raw message