php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60516 Bad Cache-Control header causes IE to rapidly re-download
Submitted: 2011-12-13 23:21 UTC Modified: 2011-12-21 14:48 UTC
From: florian dot hoech at gmx dot de Assigned: bjori (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Windows
Private report: No CVE-ID: None
 [2011-12-13 23:21 UTC] florian dot hoech at gmx dot de
Description:
------------
---
From manual page: http://www.php.net/function.readfile#refsect1-function.readfile-examples
---

This is a documentation problem. The header
'Cache-Control: must-revalidate, post-check=0, pre-check=0'
in the example can cause MSIE to rapidly re-download, wasting massive bandwith in the worst case (in my case one original request for a 14 MB file caused 469 automatic subsequent downloads by MSIE). It would be best to remove that header from the example.
Background info can be found here:
http://blogs.msdn.com/b/ie/archive/2006/06/01/613132.aspx
(It does NOT only affect IE 7 Beta 2 as the article may make it seem. I was able to verify the problem in IE 9).

Test script:
---------------
Just the example script from the docs with any file.

Expected result:
----------------
The file should be downloaded only once per request.

Actual result:
--------------
One original request for a 14 MB file caused 469 automatic subsequent downloads by MSIE when the 'Cache-Control: must-revalidate, post-check=0, pre-check=0' header was set.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-13 23:27 UTC] florian dot hoech at gmx dot de
Forgot to mention the downloads are 'background' downloads, the user of the browser won't notice them until he monitors bandwidth. Of course the requests appear in access.log on the server and waste actual bandwidth.
 [2011-12-21 14:47 UTC] bjori@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&revision=321292
Log: post- and pre-check headers aren't needed for IE (and in fact IE bugs cause them to double download the file), see bug#60516
 [2011-12-21 14:48 UTC] bjori@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: bjori
 [2011-12-21 14:48 UTC] bjori@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 20:00:02 2026 UTC