From 332830f1aec576cd550638065fc08afc665044ff Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 2 Apr 2004 13:45:26 +0000 Subject: [PATCH] remove Pragma:no-cache header, and set Content-Length and Cache-Control for viewing .pdf invoices with IE over SSL. http://support.microsoft.com/default.aspx?scid=kb;en-us;323308 --- htetc/global.asa | 1 - htetc/handler.pl | 2 +- httemplate/view/cust_bill-pdf.cgi | 6 +++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htetc/global.asa b/htetc/global.asa index c3dab19e7..29b3fe199 100644 --- a/htetc/global.asa +++ b/htetc/global.asa @@ -56,7 +56,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; diff --git a/htetc/handler.pl b/htetc/handler.pl index 45f81b3b9..1ea87e744 100644 --- a/htetc/handler.pl +++ b/htetc/handler.pl @@ -144,7 +144,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'; diff --git a/httemplate/view/cust_bill-pdf.cgi b/httemplate/view/cust_bill-pdf.cgi index 4578b7b9c..2a86c3246 100755 --- a/httemplate/view/cust_bill-pdf.cgi +++ b/httemplate/view/cust_bill-pdf.cgi @@ -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 %> -- 2.11.0