Book print does not cache properly

Created on 25 July 2019, almost 6 years ago
Updated 30 January 2023, over 2 years ago

Problem/Motivation

Cache Tags and Cache Contexts are missing from the Book Export HTTP Response when using the Dynamic Page Cache. On platforms with an Edge cache layer (ie. using Varnish, Cloudflare, etc.) the Book Export HTTP response continues to be served from the Edge cache, even after changes to the Book content or embedded images or other media are made.

Book pages, in contrast, do return Cache Tags and Cache Contexts headers in the HTTP response when using the Dynamic Page Cache, allowing book pages to flush from Edge caches when any content, embedded images or other media is changed.

Proposed resolution

The Drupal core BookController::bookExport method currently returns a Symfony Response object. Using a CacheableResponse object instead will allow bubbleable, cacheability metadata to be returned along with the HTTP Response.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Return Cacheability metadata with Book Export HTTP responses to fix Edge cache stickiness for Book exports.

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
BookΒ  β†’

Last updated 1 day ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @pwolanin
Created by

πŸ‡¦πŸ‡ΊAustralia tvhung

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.

Production build 0.71.5 2024