<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
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
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";
#------------------------------------------------------------------------------
($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);
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