Question

does magento suppose to create separate cache for each visitor? I configured varnish using magento guide, but each new visitor gets cacheble page only on seocond load.

Was it helpful?

Solution

No, according to Alan Kent's excellent article Varnish is only used to cache public content. Private content is handled different and basically ends up being cached locally in the user's browser. To quote the linked article:

What Magento 2 does instead is to fetch a (typically) 95% complete page and then rely on JavaScript and AJAX to inject the last 5% of user specific content onto the page.

It sounds like something is wrong in your configuration, in my tests so far I haven't seen behavior as you describe (only getting a cacheable page on second load).

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top