سؤال

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

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top