cancel
Showing results for 
Search instead for 
Did you mean: 

X-Magento-Vary changes during load

X-Magento-Vary changes during load

I need to show something based on a user's session attribute, and with full page caching, my understanding is the best way to do that is by adding an httpcontext variable based on that session value.  I'm using beforeDispatch, and seeing some odd behavior.

 

When I first start loading the page, the X-Magento-Vary starts off at one value which is incorrect, and so the page loads the incorrect content.  Shortly after the page starts loading (and before it's finished), the X-Magento-Vary value changes to the correct one, but at that point it's too late.

 

Since customer group / logged in state are used, I'm assuming other data from the customer session is acceptable to use here.  Is there any good way to diagnose what's going on there?

1 REPLY 1

Re: X-Magento-Vary changes during load

Hi there,

 

I know this is from a number of years ago, but I am having this issue and really struggling with it.

 

Did you get an answer on what was causing this in the end?

 

Thanks for your time.