php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #34223 Some of suggested no-cache headers are useless
Submitted: 2005-08-23 21:08 UTC Modified: 2005-09-06 17:03 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: pornel at despammed dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
 [2005-08-23 21:08 UTC] pornel at despammed dot com
Description:
------------
In http://php.net/header

// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");


Despite disclaimer under this example I think useless headers should be removed.

last-modified is last resort in finding freshness of an object, and is not needed when expires and cache-control are present.

post-check and pre-check headers are always ignored when no-cache is specified. 

on most proxies no-cache and no-store make no difference, but the latter may impose extra restrictions in handling "sensitive information" and should not be abused just for any dynamic data.



Expected result:
----------------
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

Actual result:
--------------
abuse of http by clueless copy'n'pasters.
backtraces to these lines in php docs :)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-06 17:03 UTC] vrana@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-2025 The PHP Group
All rights reserved.
Last updated: Sun Aug 03 18:00:03 2025 UTC