-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Magento_Persistent performance overhead on non-cart, non-checkout pages #39948
Copy link
Copy link
Open
Labels
Area: FrameworkComponent: PersistentIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.May be fixed according to the position in the backlog.Progress: doneReported on 2.4.xIndicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
Metadata
Metadata
Assignees
Labels
Area: FrameworkComponent: PersistentIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.May be fixed according to the position in the backlog.Progress: doneReported on 2.4.xIndicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
Type
Projects
Status
Ready for Development
Summary
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
persistent_quoteobserver does not load the quote before it's absolutely necessaryActual result (*)
persistent_quoteis loading the full quote with expensiveassignProductsfunction callMagento_Persistentaddscontroller_action_predispatcheventpersistent_quoteobserver. On non-cart, non-checkout pages(e.g. PDP) it's loading quote and it impacts the TTFB significantly. Due to the observer's private function declarations, overriding the logic inside the observer class requires developers to add class preference or patch the observer class directly. There is no "ok" way to implement workaround for this.magento2/app/code/Magento/Persistent/Observer/CheckExpirePersistentQuoteObserver.php
Line 164 in dc87600
magento2/app/code/Magento/Persistent/Observer/CheckExpirePersistentQuoteObserver.php
Line 166 in dc87600
Both of these calls could be simplified by checking the quote table data directly. The business logic will still be satisfied. If the quote has to be expired, then the quote probably needs to be still loaded fully.
Examples
Proposed solution
Do not load quote fully if not needed.
I have prepared a sample class that could be used as a wrapper for getting the required data instead, see Examples
Release note
No response
Triage and priority