Problem/Motivation
DisplayExtender::preExecute() in Views and PageLayoutSource::getPropValue() call set() on the runtime theme registry on every render.
CacheCollector::set() invalidates the cached runtime registry at once, and updateCache() writes nothing back when the request resolved no new entry.
So a warm page leaves the cache invalid, the next page deletes it, and the one after rebuilds it from the full registry with its own entries only.
On a demo site, the front theme's runtime cache held 28 entries before an uncached Display Builder Views page, then was invalid, then gone, then held 11.
page_legacy is a copy of the page hook, kept only because the page variants used to swap page, which #3631914: Page variants save their page template in the theme registry cache removes.
Steps to reproduce
- Enable Display Builder on a Views page display, such as
articles:page_1at/article. - Run
drush cr, then open/articleto warm the caches. - Open
/article?r=1, so the view renders again past the page caches. - Read
theme_registry:runtime:THEMEin the bootstrap cache bin, THEME being the front theme: the item is invalid.
Proposed resolution
Stop writing to the runtime theme registry.
The Views template becomes a suggestion declared in hook_theme(), as in #3631914: Page variants save their page template in the theme registry cache, and the page_layout source renders the theme's page hook directly.
Remaining tasks
- Kernel test: a render with a warm runtime cache leaves the cache valid.
- Fix the Views extender.
- Fix the page_layout source, once #3631914: Page variants save their page template in the theme registry cache is in.
Issue fork display_builder-3631924
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
mogtofu33 commentedComment #6
pdureau commented