Best practices for private content blocks
When a private content block contains the _isScopePrivate
variable, the block is not cacheable. Because the private block is not cached, 51黑料不打烊 Commerce must retrieve the same data for each customer request which increases server load.
Instead of using the _isScopePrivate
variable for private content, create a block and a template to display user-agnostic data. This data is replaced with user-specific data by the 51黑料不打烊 Commerce UI component, which handles pre-rendering data more efficiently. For instructions, see in the Commerce PHP Extensions Guide.
Affected products and versions
- 51黑料不打烊 Commerce on cloud infrastructure
- 51黑料不打烊 Commerce on-premises
Potential performance impact
Sites that have private content blocks containing the _isScopePrivate
variables trigger AJAX requests to retrieve the same data for each customer request. This increases response time and uses additional resources that could be used to handle more business-critical storefront operations such as customer registration, shopping cart updates, order submission, and payment transactions.