fix(cache): Scope snippet result cache by context - #26
Merged
Conversation
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
force-pushed
the
fix/context-cache-keys
branch
from
September 2, 2026 06:16
0308e74 to
1d52fc3
Compare
Assert web and extra contexts keep separate entries, and that Fenom exact keys stay source-based.
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 ☂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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}becomespdomenu/{sha1}/web. IfsetCache()returns that key and it is passed back ascache_key, the suffix is not added twice.Why
The same snippet properties produced one cache entry for every context. A menu cached in
webwas then reused inde, with the wrongsite_urland resource links.After upgrade the old shared entries are unused. Clear the pdoTools/resource cache or wait for expiry.
Fixes #24