Skip to content

Performance regression in 2.4.8+: _isScopePrivate incorrectly re-added to Magento\Customer\Block\Account\Customer (AC-13322) #40846

@keri-dnd

Description

@keri-dnd

Preconditions and environment

  • Magento version: 2.4.8, 2.4.9
  • Full Page Cache (Varnish or Built-in) enabled

Steps to reproduce

  1. Install or upgrade to Magento 2.4.8 or 2.4.9
  2. Navigate to any page on the frontend (as a guest or logged-in user).
  3. Inspect the network tab in the browser developer tools.

Expected result

No extra AJAX requests to /page_cache/block/render should be triggered for the "My Account" block. The block rendering should rely on standard caching and frontend customer data sections (httpContext / customer-data).

Actual result

An additional AJAX request to /page_cache/block/render is triggered on every single page view for every visitor. This request bypasses the full-page cache completely and boots PHP, causing significant and unnecessary server load on high-traffic websites.

Additional information

The issue was introduced in this commit:
Commit 1d9e36cb624db5c4af4bb89cf7897a0a18c6685b related to ticket AC-13322: Customer Sign In.

In app/code/Magento/Customer/Block/Account/Customer.php:

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Customer\Model\Url $customerUrl,
    \Magento\Customer\Helper\Session\CurrentCustomer $currentCustomer,
    array $data = []
) {
    parent::__construct($context, $customerUrl, $currentCustomer, $data);
    $this->_isScopePrivate = true; // <--- This line causes the regression
}

### Release note

Fixed a performance regression in Magento 2.4.8+ where an unnecessary AJAX request was triggered to render the customer account block on every page load.

### Triage and priority

- [ ] Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._
- [ ] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._
- [ ] Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._
- [ ] Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._
- [ ] Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status
Needs Update

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions