Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 298690

Add a CachedPlaceholderStrategy and use a placeholder to render the navigation toolbar

$
0
0

Problem/Motivation

Spin-off from #3493406: Add render caching for the navigation render array.

We could render the entire navigation menu via a placeholder, this would have the following benefits:

1. With dynamic_page_cache, we'd only cache the placeholder HTML in the cache item, reducing overall cache bin sizes by quite a lot.

2. With big pipe, we'd be able to send HTML <head> and the page header, and start rendering them earlier. On some sites this will significantly speed up Largest Contentful Paint.

3. With big pipe, navigation-specific libraries will be added via Big Pipe in isolation from other libraries on the page, this should improve CSS and JavaScript aggregation efficiency and cache hits rates, because they won't end up bundled with other aggregates that may or may not include other libraries loaded by different front and admin-facing pages.

However there is one potential drawback:

The navigation bar is consistently in the same spot on every page and it currently loads fairly quickly. Placeholdering it may make it load later relative to other elements in the main viewport and could increase Content Layout Shift / (jank) and potentially make Largest Contentful Paint worse (contrary to the pro above) if it moves elements around that would otherwise have finished rendering.

If this is an issue, we might be able to improve it with a big pipe preview, but then we want to avoid flickering, layout shift etc. from that too. It would at least need to be exactly the same size container just without the inner text or something. Because it's full height and fixed width (I think) that might be doable.

We should be able to get an idea on the last point via manual testing between Standard, Umami and Drupal CMS.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 298690


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>