| Welcome to WebmasterWorld Guest from 18.104.22.168 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
|ob gzhandler() not setting "Vary: Accept-encoding" when uncompressed|
I am using ob_gzhandler() to dynamically handle GZIP compression on a server which doesn't allow it done by htaccess.
It adds "Accept-encoding" to the Vary: header, as it should, when the body is Gzipped.
However when the client sends no Accept-Encoding: header, and the response is accordingly uncompressed, it does not add this Vary header.
This causes various bug checking tools to complain, and could mess up caching.
I know I can manually add Vary: Accept-encoding, and I am, but is that my only solution - just confirming this is a bug and I'm not missing something?
Have you searched ob_gzhandler Accept-encoding? I've not run into the issue you are describing but perhaps it is out there?
Sorry I cannot be of more help...
mipapage, have you tested it with a browser not sending an Accept-Encoding request header? What version of PHP?
Why not use zlib instead? From the ob_gzhandler [php.net] page itself:
You cannot use both ob_gzhandler() and zlib.output_compression. Also note that using zlib.output_compression is preferred over ob_gzhandler().
Try it instead, see if your issues are resolved. Much better solution anyway.
Shared host, I don't have access to php.ini.
I'd also want the ability to not use it with some PHP scripts (piping/generating images).
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved