Skip to content

fix(cache): Scope snippet result cache by context - #26

Merged
Ibochkarev merged 2 commits into
masterfrom
fix/context-cache-keys
Sep 2, 2026
Merged

fix(cache): Scope snippet result cache by context#26
Ibochkarev merged 2 commits into
masterfrom
fix/context-cache-keys

Conversation

@Ibochkarev

@Ibochkarev Ibochkarev commented Sep 2, 2026

Copy link
Copy Markdown
Member

What

pdoMenu, pdoSitemap, and pdoPage now store snippet results under a key that includes the current context. Fenom compile and error dumps stay on an exact key.

pdomenu/{sha1} becomes pdomenu/{sha1}/web. If setCache() returns that key and it is passed back as cache_key, the suffix is not added twice.

Why

The same snippet properties produced one cache entry for every context. A menu cached in web was then reused in de, with the wrong site_url and resource links.

After upgrade the old shared entries are unused. Clear the pdoTools/resource cache or wait for expiry.

Fixes #24

@Ibochkarev
Ibochkarev marked this pull request as ready for review September 2, 2026 02:54
pdoMenu, pdoSitemap, and pdoPage reused one cache entry across
contexts when cache_key or cacheKey was set. Append the current
context to result keys. Fenom compile dumps stay on an exact key.

Fixes #24
@Ibochkarev
Ibochkarev force-pushed the fix/context-cache-keys branch from 0308e74 to 1d52fc3 Compare September 2, 2026 06:16
Assert web and extra contexts keep separate entries, and that
Fenom exact keys stay source-based.
@Ibochkarev Ibochkarev self-assigned this Sep 2, 2026
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@Ibochkarev
Ibochkarev merged commit 1b9c02b into master Sep 2, 2026
15 checks passed
@Ibochkarev
Ibochkarev deleted the fix/context-cache-keys branch September 2, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Different caches for different contexts

1 participant