In the last few days, I faced a strange problem during my job: a web application, running on Tomcat, dynamically generates some PDF reports.
When we activated the HTTPS to secure the connection, users with Internet Explorer 8 were no longer able to display those PDF files: Adobe Reader was correctly started but the browser‘s window remained blank.
The problem wasn’t appearing with Internet Explorer 9 or with different browsers (Firefox, Chrome…).
After some investigation, we found that the problem was caused by two HTTP headers that forced the browser not to save the page into the cache:
First, being the application balanced by a F5 LTM appliance, I wrote an iRule to remove those headers:
when HTTP_RESPONSE { if { [HTTP::header Content-Type] equals "application/pdf" } { HTTP::header remove "Cache-Control" HTTP::header remove "Pragma" } } |
Then, our DEV team developed a Tomcat Filter, that – if Internet Explorer 8 is detected from the user-agent field – removes the headers using a custom ServletResponse.