Customer id and customer e-mail are added to the HttpContext in Ls\Omni\Plugin\App\Action\Context::aroundDispatch. This causes each customer to have an own page cache built for the entire webshop making page load time slower as they should be.
The values stored in the HttpContext object are loaded later on requests that not seem to be cached. In places like this you can just use the customerSession object (\Magento\Customer\Model\Session) to load this data like you already do when adding the data to the HttpContext object. Since this data is loaded asychronous or in the cart using this methods seems to be redundant.
Preconditions (*)
Magento 2.4.x
lsretail/lsmag-two 2.3.0
Enable Varnish
Steps to reproduce (*)
Login as customer, load random page the is stored in page cache
Refresh page
Login as other customer in same customer group with same currency
Visit the same page
Expected result (*)
Page should be loaded from Varnish giving a 50ms like response
Actual result (*)
The page cache for new customer is not prewarmed and page speed (ttfb) is not a fast as it should be.
Hi @xcom-magento, thanks for reporting this. This issue has already been addressed and is available in the master branch and will be added in our next release.
Customer id and customer e-mail are added to the HttpContext in
Ls\Omni\Plugin\App\Action\Context::aroundDispatch
. This causes each customer to have an own page cache built for the entire webshop making page load time slower as they should be.The values stored in the HttpContext object are loaded later on requests that not seem to be cached. In places like this you can just use the customerSession object (
\Magento\Customer\Model\Session
) to load this data like you already do when adding the data to the HttpContext object. Since this data is loaded asychronous or in the cart using this methods seems to be redundant.Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)