ZF-3803: Zend_Cache_Frontend_Page shouldn't check if headers have been sent
Description
I currently have an application that won't cache headers unless I remove the check for headers_sent().
headers_sent() should not be checked in Zend_Cache_Frontend_Page since headers have not been sent if output buffering is enabled. headers_list() provides the list of headers regardless if they have been sent or not, so it's safe to call headers_list() regardless.
Comments
Posted by Fabien MARTY (fab) on 2008-08-12T08:40:00.000+0000
may you provide a patch for this ?
I don't really understand why it's a critical bug ?
What options do you use for the frontend ?
It sounds to be a very specific problem...
Posted by Jordan Ryan Moore (jordanryanmoore) on 2008-08-12T09:23:19.000+0000
It's a critical bug because when I tell the page cache to memorize headers (or just the content-type header for 1.5.3), it doesn't. The code below is from my bootstrap:
With the current Zend_Cache_Frontend_Page from 1.5.3, 1.6RC2, or trunk, headers aren't cached. If I apply the patch that I've attached, headers are cached correctly.
Posted by Fabien MARTY (fab) on 2008-08-13T00:39:41.000+0000
ok, and you use output buffering (by yourself) + Zend_Cache_Frontend_Page (which use output buffering too)
and using both reach to this bug ? I'm right ?
Posted by Jordan Ryan Moore (jordanryanmoore) on 2008-08-13T09:53:28.000+0000
Nope. I'm not starting any output buffering other than what's started by Zend_Cache_Frontend_Page.
Posted by Fabien MARTY (fab) on 2008-08-14T01:47:42.000+0000
ok, I just commited your fix into SVN trunk
can you confirm it's ok four you with the SVN trunk ?
if it's ok, I will fix this on the 1.6 branch too
thanks
Posted by Jordan Ryan Moore (jordanryanmoore) on 2008-08-14T07:33:24.000+0000
Works like a charm now. Thank you.
Posted by Fabien MARTY (fab) on 2008-08-14T08:28:32.000+0000
fixed in 1.6 branch too (many thanks)