Smile-SA / magento2-module-store-locator

Magento 2 store locator module
50 stars 57 forks source link

_isScopePrivate variables configured making the block not cacheable. #155

Open almeidarobertop opened 1 year ago

almeidarobertop commented 1 year ago

Preconditions

The following table shows the private content block(s) that have the _isScopePrivate variables configured making the block not cacheable.

Smile/StoreLocator/Block/ContactForm.php

Recommendation Do not use the _isScopePrivate property in your blocks. This property is obsolete and will not work properly. Replace _isScopePrivate property by private content instead.

Root Cause The _isPrivateScope variable is making block(s) not cacheable.

Scenario/Preconditions Since private content is specific to individual users, it is reasonable to handle this on the client-side (i.e., the web browser) instead of hitting the server for retrieving the same data on each customer request.

Site Impact Each request to Magento can trigger additional Ajax requests for non-cacheable blocks causing negative site performance.

Magento Version : 2.4.6-Beta1 EE (Cloud Pro)

Module Store Locator Version : 2.1

Environment : Production

Third party modules : NA

almeidarobertop commented 1 year ago

Adobe's suggestion https://developer.adobe.com/commerce/php/development/cache/page/private-content/