18

Our full page cache seems to be based on session. If I open an incognito window with chrome and visit one of the pages, it warms the cache, and the second page load is much faster, however, if I close that window and open a new incognito window, the page is no longer in the full page cache, and has to be warmed again. We believe this is because of a sidebar that shows the user the contents of their cart.

I have moved that html to a new phtml file, squared away the layout xml blocks, and now I am working on the cache.xml file....

All of the examples I have found for cache.xml refer to modules, however, I did not use a module for my layout xml blocks, I used core/template...

Is there any chance someone could shed some light on a caching block of xml that doesn't require a module and/or model.?

2
  • Are you using Magento Enterprise full page cache or are you using a 3rd party tool like Varnish? If you have a visible cart then the page will use the session as part of the cache key. Incognito mode deletes all cookies after close so you will get a new session after opening the page again. Punching out has problems. Fabrizio has an excellent post on it: fabrizio-branca.de/… Jan 26, 2013 at 15:07
  • tweetorials.tumblr.com/post/10160075026/… may help.
    – B00MER
    Jan 28, 2013 at 5:31

1 Answer 1

6

There is no way to create a placeholder in Enterprise Edition without having a module to contain the cache.xml which in turn is home to the placeholder definition. So if you need to have a custom hole in the full page cache, you will need to create a module to define it.

The sidebar cart block which is built-in does have a placeholder out of the box. That placeholder tags it's cached contents based on the user session. The main content of the page will load from the cache having been warmed from other users, it is only this "hole" in it which has to be filled and generated on a per-user basis. You should also note that when the user's cart contents change, this hole's contents will be re-generated and cached.

Note, the above is on the assumption that it is indeed the Enterprise Edition FPC and hole-punching you are referring to, not something like Varnish. If you are using Varnish (with a proper configuration), it will not serve pages from the cache on the first visit to Magento. This is because on the first visit the user's request must be passed through to Magento so that the application can generate a session for them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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