One of the applications I’ve been working on generates PDF files which the customer can download. I’m using the FPDF and FPDI libraries to import PDFs and create copies with generated contents. This has been really easy to code, and it’s been working flawlessly in both Firefox and Safari. When we started testing under Internet Explorer thing started breaking. The problem was that IE would not let the user download the file. The only feedback we got was error messages like “The file is currently unavailable or cannot be found. Please try again later.” and “The file could not be stored in cache”. After spending some time debugging I found out that IE has problems with file downloads over HTTPS. Google pointed me to this post. The guy in that post spent six hours figuring it out, and he probably saved me six hours as well. The magic required to satisfy Internet Explorers needs:

1
2
header('Cache-Control: maxage=3600');
header('Pragma: public');

Spread the message so others can spare some time!