diff --git a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php index 1bad70c..b8c86b2 100644 --- a/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php +++ b/core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php @@ -120,6 +120,12 @@ public function onRespond(FilterResponseEvent $event) { // explicitly not cacheable or that caching headers are already set from // another place. if (!($response instanceof CacheableResponseInterface)) { + if (!$this->isCacheControlCustomized($response)) { + $expire_header = $response->headers->get('Expires'); + if (!$expire_header) { + $this->setExpiresNoCache($response); + } + } return; }