diff --git a/core/modules/image/image.services.yml b/core/modules/image/image.services.yml index 1447e03..dee37f2 100644 --- a/core/modules/image/image.services.yml +++ b/core/modules/image/image.services.yml @@ -6,3 +6,7 @@ services: plugin.manager.image.effect: class: Drupal\image\ImageEffectManager parent: default_plugin_manager + image.page_cache_request_policy.image_path: + class: Drupal\image\PageCache\IsPrivateImageStyleDownloadPath + tags: + - { name: page_cache_request_policy } diff --git a/core/modules/image/src/Controller/ImageStyleDownloadController.php b/core/modules/image/src/Controller/ImageStyleDownloadController.php index 3e4bcf0..a18c677 100644 --- a/core/modules/image/src/Controller/ImageStyleDownloadController.php +++ b/core/modules/image/src/Controller/ImageStyleDownloadController.php @@ -155,7 +155,6 @@ public function deliver(Request $request, $scheme, ImageStyleInterface $image_st } if ($success) { - drupal_page_is_cacheable(FALSE); $image = $this->imageFactory->get($derivative_uri); $uri = $image->getSource(); $headers += array( diff --git a/core/modules/image/src/PageCache/IsPrivateImageStyleDownloadPath.php b/core/modules/image/src/PageCache/IsPrivateImageStyleDownloadPath.php new file mode 100644 index 0000000..d78bd21 --- /dev/null +++ b/core/modules/image/src/PageCache/IsPrivateImageStyleDownloadPath.php @@ -0,0 +1,30 @@ +getPathInfo(), '/system/files/styles/') === 0) { + return RequestPolicyInterface::DENY; + } + } + +}