Skip to content

[6.x] Keep .meta files out of the container listing cache - #15610

Open
edalzell wants to merge 4 commits into
statamic:6.xfrom
edalzell:fix/container-listing-excludes-meta
Open

edalzell wants to merge 4 commits into
statamic:6.xfrom
edalzell:fix/container-listing-excludes-meta

Conversation

@edalzell

@edalzell edalzell commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

AssetContainerContents::all() caches the raw recursive listing, .meta/*.yaml included. With cache_meta on that's one meta file per asset, so roughly half the cached payload is entries nothing reads through the listing. On one site that's 197k entries, an 80 MB serialized key, and an OOM on load.

The listing now rejects .meta paths (files and the .meta directories themselves) before caching. metaFilesIn() lists <folder>/.meta (or <folder> recursively) from the filesystem on demand instead of filtering the cache, and Asset::metaExists() checks the disk directly since the listing no longer knows about meta.

Tradeoffs: metaFiles() at the root recursively is now a full uncached disk walk per AssetContainerContents instance (only assets:meta:clean calls it today), and metaExists() is one disk exists() per syncOriginal() even when the CP already has the listing loaded. Left the .meta rejects in filteredFilesIn()/filteredDirectoriesIn() so an already-warm pre-upgrade cache still behaves.

#15609 is stacked on this and should merge after it.

Closes #15608

@ryanmitchell

Copy link
Copy Markdown
Contributor

Love this, should make a big difference on our bigger sites too. Thanks Erin!

@edalzell

edalzell commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Love this, should make a big difference on our bigger sites too. Thanks Erin!

klipy-8287011981677991

This branch has not been deployed

No deployments
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.

Container listing cache includes every .meta sidecar, doubling its size

2 participants