remove Pragma:no-cache header, and set Content-Length and Cache-Control for viewing...
authorivan <ivan>
Fri, 2 Apr 2004 13:44:56 +0000 (13:44 +0000)
committerivan <ivan>
Fri, 2 Apr 2004 13:44:56 +0000 (13:44 +0000)
htetc/global.asa
htetc/handler.pl
httemplate/view/cust_bill-pdf.cgi

index 65f3355..a773bb9 100644 (file)
@@ -68,7 +68,6 @@ use FS::export_svc;
 use FS::msgcat;
 
 sub Script_OnStart {
-  $Response->AddHeader('Pragma' => 'no-cache');
   $Response->AddHeader('Cache-control' => 'no-cache');
 #  $Response->AddHeader('Expires' => 0);
   $Response->{Expires} = -36288000;
index 8d4f1e7..f970df8 100644 (file)
@@ -198,7 +198,7 @@ sub handler
     #eorar
 
     my $headers = $r->headers_out;
-    $headers->{'Pragma'} = $headers->{'Cache-control'} = 'no-cache';
+    $headers->{'Cache-control'} = 'no-cache';
     #$r->no_cache(1);
     $headers->{'Expires'} = '0';
 
index 4578b7b..2a86c32 100755 (executable)
@@ -8,6 +8,10 @@ my $invnum = $1;
 my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
 die "Invoice #$invnum not found!" unless $cust_bill;
 
+my $pdf = $cust_bill->print_pdf;
+
 http_header('Content-Type' => 'application/pdf' );
+http_header('Content-Length' => length($pdf) );
+http_header('Cache-control' => 'max-age=60' );
 %>
-<%= $cust_bill->print_pdf %>
+<%= $pdf %>