homepage Welcome to WebmasterWorld Guest from 54.196.168.78
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
ob gzhandler() not setting "Vary: Accept-encoding" when uncompressed
badbadmonkey




msg:4350208
 4:04 am on Aug 11, 2011 (gmt 0)

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?

 

mipapage




msg:4350712
 10:21 am on Aug 12, 2011 (gmt 0)

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...

badbadmonkey




msg:4350732
 11:49 am on Aug 12, 2011 (gmt 0)

mipapage, have you tested it with a browser not sending an Accept-Encoding request header? What version of PHP?

coopster




msg:4351008
 10:51 pm on Aug 12, 2011 (gmt 0)

Why not use zlib instead? From the ob_gzhandler [php.net] page itself:


Note:
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.

[php.net...]

badbadmonkey




msg:4351011
 11:18 pm on Aug 12, 2011 (gmt 0)

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).

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved