The url rewrite on line 18 of templates/includes/static.vcl.tmpl causes 404 image responses from Drupal when an anonymous user visits a page with responsive image styles.
This is due to the itok parameter being removed by line 18. The ImageStyleDownloadController processes the request in Drupal and passes back a 404 as there is no valid itok.
Steps to reproduce:
Stock Docker4Drupal with Varnish and the VARNISH_CACHE_STATIC_FILES environment variable set.
Drupal configured to cache (/admin/config/development/performance).
The following modules enabled: responsive_image, media, media_library.
Add a media field to a content type.
Configure a responsive image style - My configuration is Bartik Breakpoint groups with Select a single image style for each breakpoint.
Change default media display to use a responsive image style.
Change media field display (if needed) to use display with responsive image style.
Add a node with an image and while logged in do not resize browser (this would cause images to generate as varnish will pass back response without altering).
Ensure page is cached via headers.
View varnish version of page and resize - any styles that were not accessed by authenticated user will return 404.
Commenting out line 18 of the include resolves this issue.
The url rewrite on line 18 of
templates/includes/static.vcl.tmpl
causes 404 image responses from Drupal when an anonymous user visits a page with responsive image styles.This is due to the
itok
parameter being removed by line 18. TheImageStyleDownloadController
processes the request in Drupal and passes back a 404 as there is no validitok
.Steps to reproduce:
Docker4Drupal
with Varnish and theVARNISH_CACHE_STATIC_FILES
environment variable set.responsive_image
,media
,media_library
.Bartik
Breakpoint groups withSelect a single image style
for each breakpoint.Commenting out line 18 of the include resolves this issue.