]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Fix not working feature for Expires parameter.
authoreldy <>
Fri, 21 Nov 2003 23:05:12 +0000 (23:05 +0000)
committereldy <>
Fri, 21 Nov 2003 23:05:12 +0000 (23:05 +0000)
docs/awstats_config.html
wwwroot/cgi-bin/awstats.model.conf
wwwroot/cgi-bin/awstats.pl

index 58a7a23f218d31cba55513e16ee95166d881149a..6efc32aa98f17b836b4ebdb69749c7bb9485b095 100644 (file)
@@ -1221,8 +1221,8 @@ AWStats 4.1+ supports both keywords AND keyphrases by default with no need of an
 
 <a name="Expires"><b>Expires</b></a><br>
 <b>Version : </b>3.1+<br>
-<br># You can add in the HTML report page a delay to force browsers to not use cache
-<br># if page is loaded a second time after this delay (in seconds).
+<br># You can add, in the HTML report page, a cache lifetime (in seconds) that
+<br># will be returned to browser in HTTP header answer by server.
 <br># This parameter is not used when report are built with -staticlinks option.
 <br># Example: 3600
 <br># Default: 0
index 440647637db90f6478b2dd2bc306a89457e23604..bfad82e21b7cd145eb899408b90b73d001c20acc 100644 (file)
@@ -809,8 +809,8 @@ UseFramesWhenCGI=1
 DetailedReportsOnNewWindows=1
 
 
-# You can add in the HTML report page a delay to force browsers to not use cache
-# if page is loaded a second time after this delay (in seconds).
+# You can add, in the HTML report page, a cache lifetime (in seconds) that
+# will be returned to browser in HTTP header answer by server.
 # This parameter is not used when report are built with -staticlinks option.
 # Example: 3600
 # Default: 0
index b1028cf8b19c619b38d3439a8adb335159beb6ba..251305a1523a1926583ee8c116022fe1b6db9554 100644 (file)
@@ -517,7 +517,7 @@ sub html_head {
                if ($BuildReportFormat eq 'xml') { print ($ENV{'HTTP_USER_AGENT'}=~/MSIE|Googlebot/i?"<meta http-equiv=\"content-type\" content=\"text/html; charset=".($PageCode?$PageCode:"iso-8859-1")."\" />\n":"<meta http-equiv=\"content-type\" content=\"text/xml; charset=".($PageCode?$PageCode:"iso-8859-1")."\" />\n"); }
                else { print "<meta http-equiv=\"content-type\" content=\"text/html; charset=".($PageCode?$PageCode:"iso-8859-1")."\" />\n"; }
 
-               if ($Expires)  { print "<meta http-equiv=\"expires\" content=\"".(gmtime(time()+$Expires))."\" />\n"; }
+               if ($Expires)  { print "<meta http-equiv=\"expires\" content=\"".(gmtime($starttime+$Expires))."\" />\n"; }
                print "<meta http-equiv=\"description\" content=\"".ucfirst($PROG)." - Advanced Web Statistics for $SiteDomain\" />\n";
                if ($AllowIndex && $FrameName ne 'mainleft') { print "<meta http-equiv=\"keywords\" content=\"$SiteDomain, free, advanced, realtime, web, server, logfile, log, analyzer, analysis, statistics, stats, perl, analyse, performance, hits, visits\" />\n"; }
                print "<title>$Message[7] $SiteDomain</title>\n";
@@ -4929,7 +4929,7 @@ sub ShowEmailReceiversChart {
 #------------------------------------------------------------------------------
 ($DIR=$0) =~ s/([^\/\\]*)$//; ($PROG=$1) =~ s/\.([^\.]*)$//; $Extension=$1;
 
-$starttime=time;
+$starttime=time();
 
 # Get current time (time when AWStats was started)
 ($nowsec,$nowmin,$nowhour,$nowday,$nowmonth,$nowyear,$nowwday,$nowyday) = localtime($starttime);
@@ -4978,11 +4978,14 @@ $QueryString='';
 if ($ENV{'AWSTATS_DEL_GATEWAY_INTERFACE'}) { $ENV{'GATEWAY_INTERFACE'}=''; }
 if ($ENV{'GATEWAY_INTERFACE'}) {       # Run from a browser as CGI
        if ($BuildReportFormat eq 'xml') { print ($ENV{'HTTP_USER_AGENT'}=~/MSIE|Googlebot/i?"Content-type: text/html\n":"Content-type: text/xml\n"); }
-       else { print "content-type: text/html\n"; }
-    
+       else { print "Content-type: text/html\n"; }
+
        # Expires must be GMT ANSI asctime and must be after Content-type to avoid pb with some servers (SAMBAR)
-       #my $ExpireDelayInHTTPHeader=0;
-       #print "Expires: ".(gmtime($starttime()+$ExpireDelayInHTTPHeader))."\n";
+       if ($Expires) {
+           print "Cache-Control: public\n";\r
+           print "Last-Modified: ".gmtime($starttime)."\n";\r
+           print "Expires: ".(gmtime($starttime+$Expires))."\n";\r
+       }
        print "\n";
 
        # Prepare QueryString