4

I recently upgraded my Enterprise store to v1.14, and am not convinced that the full page cache is working properly. I say this because there's no difference in page loading times with the FPC turned on/off.

I spent hours trawling through the cache-related core classes, debugging everything, and I noticed that if I logged $this->getMetadata('cache_subprocessor') in the extractContent() method, it was always empty, and therefore - by my understanding - the full page cache would never be rendered!

I'd like help understanding. Please correct me if any of this logic is wrong:

1) To extract content from the cache storage, Magento calls upon Enterprise_PageCache_Model_Processor::extractContent()

2) This method checks if the $content parameter passed to it is empty, and if it is, attempts to load the content from the relevant subprocessor:

 if (!$content && $this->isAllowed()) {
     $subprocessorClass = $this->getMetadata('cache_subprocessor');
     // etc
 }

3) However, that cache_subprocessor metadata key is set inside the processRequestResponse() method; a method which is only called inside the observer method Enterprise_PageCache_Model_Observer::cacheResponse(), which itself is only called after a page has been rendered (controller_front_send_response_before).

So, as I understand it, the cache_subprocessor can only be set once a page has been rendered. But the cache_subprocessor is itself required to render a page from the cache.

If this is correct, how can the full page cache ever possibly work, if a page must be rendered (in the current browsing session, in order to set the cache_subprocessor) before the cache can be used (by the current browsing session)?

  • Check this inchoo.net/magento/… – Adarsh Khatri Sep 6 '15 at 4:54
  • @AdarshKhatri Thanks, I'm actually using Redis already for all cache types, but my question is more generic in nature. – WackGet Sep 6 '15 at 5:48
0

Yes, your conclusion is the same as we came to, but it applies only to session dependant content and why things like recently viewed products work so badly.

It could be different, but I remember that it isn't able to inject the place holder as by the time it knows what it is, it should have written it already.

I can see if I can conjure it again from documents.

0

I had this same problem today. Earlier in the day, I had refactored some code, changing a constant variable name in a module. Unknown to me, this constant was used in another a block template in the before_body_end core text list.

While working on another module that used FPC placeholders, I wondered why the CMS home page was not being cached. After I read your post and noted that the cache metadata was set by observers of the controller_front_send_response_before, I set breakpoints in the Mage_Cms_IndexController and stepped through the renderLayout process. When it got to the block template that used the old constant name, a fatal PHP error was thrown. Strangely, at this point most of the page had already been rendered and returned to my browser normally. If I had not read your post, I would still be scratching my head. So thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.