Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Drupal 7 page cache is very unflexible, as it only considers the request URI as part of the cache key.
This has caused trouble in the past. It triggered a security release of the RestWS module. An issue has been opened for the last two years, and is still unfixed.
It will cause trouble in the future, as people want to implement more granular caching techniques on existing sites.
Proposed resolution
Add an API that allows customizing the page cache ID.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2364011.patch | 3.76 KB | Damien Tournoud |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud at Centarro commentedSee #1855260: Page caching broken by accept header-based routing and #2364011: [meta] External caches mix up response formats on URLs where content negotiation is in use for related issues in Drupal 8.
Comment #2
dawehnerSounds like a direct duplicate of #2062463: allow page cache cid to be alterable which already has some form of patch.
Comment #3
Damien Tournoud CreditAttribution: Damien Tournoud at Centarro commentedThe other one is a Drupal 8 issue. In Drupal 8, the whole cache implementation is swappable, so it is already supported there (albeit with a lot of work).
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud at Centarro commentedHere is a rough and untested patch.
Comment #6
Damien Tournoud CreditAttribution: Damien Tournoud at Centarro commentedComment #7
Damien Tournoud CreditAttribution: Damien Tournoud at Centarro commentedComment #8
Damien Tournoud CreditAttribution: Damien Tournoud at Centarro commented