Problem/Motivation

Discovered while poking around in #3612177: Update autoload classmap for Symfony runtime and etc.

PageCache::set() stores a complete HtmlResponse object.

HtmlResponseAttachmentsProcessor leaves the attachments on the response, so every cache hit unserializes the library list, the drupalSettings array, the html_head render arrays and the CacheableMetadata.

PageCache::lookup() only uses the status, headers and content.

Steps to reproduce

Proposed resolution

Only cache a Response containing the data that PageCache::lookup() needs.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3629680

Command icon 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

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review

Implemented the change and a test.

In the test this saves about 1.7Kb per page cache entry, but this is in the Stark theme - realistic themes will have more libraries, html_head entries, etc.