Turbo: use Cache API for Turbo cache

Created on 3 July 2025, about 1 month ago

Problem/Motivation

At the time of writing, Turbo only stores its cache in memory and not in any persistent storage, so reloads completely wipe out its cache. Additionally, Turbo seems to limit the number of cached snapshots it keeps in memory - for good reason - which means that preloading links (see 📌 Add a lazy link preloader to warm Turbo and Drupal caches while scrolling Active ) is even more likely to result in wasted data transfer.

Steps to reproduce

Do a full load after a bunch of stuff is preloaded, note how it needs to send requests to preload the same things again. Also note how older links may need to be fetched again during the same Turbo session.

Proposed resolution

It looks like they tried and then reverted a pull request to add support for the Cache API. It sounds like it was mostly working but had some issues, and that they do intend to merge it in again once they can fix the issues they encountered. It may be worth trying it to see if we're affected by any of the issues they encountered, because if not, then we would instantly have persistent caching.

Remaining tasks

Patch Turbo and test it out.

User interface changes

Cached snapshots displayed more.

API changes

Probably none.

Data model changes

None.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada ambient.impact Toronto

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024