Issues

ZF-8867: Page cache doesn't work from the controller.

Issue Type: Bug Created: 2010-01-19T05:24:30.000+0000 Last Updated: 2010-01-28T03:43:03.000+0000 Status: Resolved Fix version(s): - 1.10.1 (10/Feb/10)

Reporter: Aram Mkhitaryan (aram.mkhitaryan) Assignee: Pádraic Brady (padraic) Tags: - Zend_Cache

Related issues: Attachments:

Description

I have initialized the page cache in the controller's action method. Not sure if it's a wrong place to create and start the page cache, but the result is that empty page is cached and after first attempt the page becomes empty.

I did some debugging and it looks like the problem comes from the point that the cache's _flush method is called and the data is cached at wrong time when the buffer is already cleared up with the ViewRenderer action helper in its render method, there the ob_start and ob_end_clean are called, which I think causes the problem.

Comments

Posted by Aram Mkhitaryan (aram.mkhitaryan) on 2010-01-19T06:58:03.000+0000

After some debugging I found that the Page cache was not working because of the output buffering in the frontcontroller. If I set the ini parameter resources.frontcontroller.params.disableOutputBuffering=true to disable the output buffering, everything works fine.

Is this the correct behaviour? Or is this still an issue that will be fixed?

Posted by Pádraic Brady (padraic) on 2010-01-28T03:22:45.000+0000

Hi Aram,

It's the correct behaviour but was never documented. I'll update the documentation now to clarify this (it puzzled me too for a while ;)). But yes, we need to disable the output buffering performed when dispatching the request. On the other hand, it doesn't seem to do an awful lot anyway so its harmless to disable.

Posted by Pádraic Brady (padraic) on 2010-01-28T03:43:02.000+0000

Note added to documentation in r20712

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts