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

Labels

Issue: needs updateAdditional information is require, waiting for responseReported on 2.4.xIndicates original Magento version for the Issue report.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

Status

Needs Update

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions