|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-02-02 13:10 UTC] nicolas dot grekas+php at gmail dot com
Description:
------------
At least ob_gzhandler, maybe gzip.outputcompress don't send a "Vary: Accept-Encoding" header when browser don't support compression. The result is that intermediate caches may get corrupted.
Reproduce code:
---------------
execute the code bellow with php-cgi :
<?php ob_start('ob_gzhander');
Expected result:
----------------
X-Powered-By: PHP/5.2.0
Content-Type: text/html
Actual result:
--------------
X-Powered-By: PHP/5.2.0
Content-Type: text/html
Vary: Accept-Encoding
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
We can't fix this issue, due to the nature of PHP output handlers. Consider he following code snippet: <?php ob_start("ob_gzhandler"); ob_end_clean(); ?> We'll get a plain response plus the Vary header, not really better either. I'd suggest you to use mod_deflate or f.e. always send the Vary header yourself when using a zlib output handler: <?php header("Vary: Accept-Encoding"); ob_start("ob_gzhandler"); ?>