Skip to content

Performing Product Resource save action on frontend area invalidates cache of all products #40074

@adamwaclawczyk

Description

@adamwaclawczyk

Preconditions and environment

Magento version containing these three lines: https://github.com/magento/magento2/blame/fab20b001d40ec34560751e1986d93c227714d19/app/code/Magento/Catalog/Model/Product.php#L2408

Steps to reproduce

  1. Enable debug logging for monitoring cache invalidation log entries
  2. Create a new module
  3. Create a frontend area router and Controller e.g. custom/index/index
  4. Implement product saving action in Controller
  5. Use $product->save() or $productResource->save($product) (check using both to confirm)
  6. Start monitoring cache_invalidate entries e.g. with tail -f -n 0 var/log/debug.log | grep "cache_invalidate"

Expected result

Only the related cache tags are invalidated

Actual result

cat_p cache tag is included in logs due to

public function cleanModelCache()

https://github.com/magento/magento2/blame/fab20b001d40ec34560751e1986d93c227714d19/app/code/Magento/Catalog/Model/Product.php#L2408

Additional information

No response

Release note

No response

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

No one assigned

    Labels

    Area: CatalogComponent: CatalogIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Reported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe 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 it

    Type

    No type

    Projects

    Status

    Ready for Development

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions