Repository navigation
perf(cache): keep the source manifest out of per-request metadata - #21
Merged
Merged
Conversation
meta.json carried source_resources, one entry per PHP file of the kernel and every bundle, and was parsed on every request although production never validates that list. The manifest now lives in sources.json next to meta.json and is read only when source validation is enabled. Metadata that still embeds source_resources is accepted unchanged.
RuntimeCacheCompatibilityTest exceeded the 500-line class limit.
A single sources.json could be replaced by a rebuild that fails before it publishes meta.json, so the active generation would be validated against another source set. Name the sidecar by generation key, verify it against the container class, remove it with its container, and skip the read under the immutable policy.
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.
Finding
Review finding K-P1:
meta.jsonembeddedsource_resources, one entry for every PHP file in the kernelsrcand in every bundlesrc.ContainerCacheManager::tryUseRuntimeContainer()parses the whole file on every request, but production never validates that list (shouldValidateCachedSourceResources()is false without debug).Change
sources.jsonnext tometa.json;meta.jsonnow only references it ("sources": "sources.json") and keepssource_fingerprint.source_resources(previous releases) is accepted unchanged; a metadata file without either form fails validation and rebuilds.Verification
RuntimeCacheCompatibilityTestasserts the sidecar layout, a warm hit, invalidation after a source edit, and the embedded legacy form.composer cs,composer static-analysisand the cache test suites pass locally in a PHP 8.5.12 container.