- 🇺🇸United States jakegibs617
remade number 7 here. Not sure if it solves the problem, needs to be tested still.
- last update
5 months ago Build Successful - last update
5 months ago Build Successful
If page does not have "X-Acquia-Site" header set then Varnish is not able to purge cache for that page on tag invalidation.
So can we create a patch for Dynamic Cache Module so that it will never set "X-drupal-dynamic-cache" header as "UNCACHEABLE" for anonymous user?
diff --git a/core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php b/core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php
index 22b51b9e..4e961b44 100644
--- a/core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php
+++ b/core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php
@@ -165,7 +165,8 @@ class DynamicPageCacheSubscriber implements EventSubscriberInterface {
}
// There's no work left to be done if this is an uncacheable response.
- if (!$this->shouldCacheResponse($response)) {
+ // Do not set uncacheable for anonymous user.
+ if (!\Drupal::currentUser()->isAnonymous() && !$this->shouldCacheResponse($response)) {
// The response is uncacheable, mark it as such.
$response->headers->set(self::HEADER, 'UNCACHEABLE');
return;
Needs work
10.3 ✨
Last updated
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
remade number 7 here. Not sure if it solves the problem, needs to be tested still.