Add support for the new cache headers (Targeted Cache-Control Cache-Status)

Created on 23 October 2021, about 3 years ago
Updated 3 December 2024, 16 days ago

Problem/Motivation

Read more details here: https://httptoolkit.tech/blog/status-targeted-caching-headers/

The spec itself is written by authors representing Fastly, Akamai and Cloudflare, so it's got good industry support already, and it's far enough through the process that it's unlikely to change drastically.

Today, both Cloudflare and Akamai already support this, so if you're using those caches you can start precisely configuring both with CDN-Cache-Control, Akamai-Cache-Control and Cloudflare-CDN-Cache-Control right now. It's pretty likely that there'll be similar support in the pipeline for many other tools and services, so watch this space.

Proposed resolution

Add support for the Targeted Cache-Control so that Drupal can maniupulate/control edge side caches.
eg.
<Target>-Cache-Control: param, param=value, param...

User interface changes

Maybe initially a textfield that alllows the user to enter manually one per line,
Ideally a way to enter lines with keys (cache name) and values (could be ttl or even advanced params).

API changes

Headers outputted:

Client-Cache-Control: must-revalidate
CDN-Cache-Control: max-age=600, stale-after-revalidate=300
Squid-Cache-Control: max-age=60
Cache-Control: no-store
Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

🇧🇪Belgium wouters_f Leuven

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇪Belgium dieterholvoet Brussels

    I'm not a big fan of having users enter complete headers manually in a text area. It feels like a step backward with the user friendly UI we have now. Even if we would go down that route, we would need validation to make sure only targeted cache-control headers are entered. Now, any header can be injected into responses by adding it to that text area.

    I guess the most user friendly way to go about this would be to allow people to add new targets, reorder them and for each target allow to change the different settings we already have now. That sounds like a lot of work though, for such a niche feature and also one that is still a proposed standard.

    If someone wants to create this I'll be happy to review and merge it, but this is not something I'm going to spend much time on.

Production build 0.71.5 2024