Stacked caches result in max-age drift in caches

Created on 17 May 2024, 7 months ago

Problem/Motivation

Placeholder:
When multiple caches are stacked max-age is not calculated correctly. When something uses the max-age of a lower cache the max-age is just reused, even if this is way later than the earlier cache. This can result in broken, invalid cached especially in situations where cache might be purged that is inside the stack of cached objects.

Some related isssues:
πŸ› ResourceObjectNormalizer::getNormalization can result in max-age drift when different sets of fields are requested Active
πŸ“Œ Add #cache['downstream-ttl'] to force expiration after a certain time and fix #cache['max-age'] logic by adding #cache['age'] Active
#2443073: Add #cache[max-age] to disable caching and bubble the max-age β†’

Steps to reproduce

Proposed resolution

When creating a new cache entry based on others, substract (expires - timestamp) from the max-age.

Remaining tasks

  1. Write failing unit test
  2. Update code that uses $this->variationCache->get and always returns cacheable objects.
  3. Profit

User interface changes

n.a.

API changes

n.a.

Data model changes

n.a.

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
CacheΒ  β†’

Last updated 2 days ago

Created by

πŸ‡³πŸ‡±Netherlands bbrala Netherlands

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024