Problem/Motivation

Currently images styled with effects does not deliver cache tags that leads to problem on external caches (Varnish tested) - no cache invalidation happens.
That's because the generated images responce does not have cache tags in responce

Proposed resolution

Pass cache tags from image style within ImageStyleDownloadController::deliver()

Remaining tasks

discus, patch, commit

User interface changes

no

API changes

no

Data model changes

no

Comments

andypost created an issue. See original summary.

andypost’s picture

Title: Add cache tags for » Add cache tags for ImageStyleDownloadController::deliver()
andypost’s picture

Filed contrib module varnish_purge issue #2908284: Purge image styles by URL

there's also a case when varnish restarted so image-styled files will be delivered by web-server so no way to pass cache tags

Berdir’s picture

Copy & paste from IRC:

The controller only delivers the image the first time when it is generated. once it has been written to the file system, there is nothing that Drupal can do to add cache tags there. The crop module solves this by adding a hash of the crop information to the image url so the url changes when the crop configuration changes

Wim Leers’s picture

#4++

Berdir’s picture

Status: Active » Closed (won't fix)

As discussed with Wim in IRC, there's not much core can do without severe performance regressions (like a force a redirect through Drupal on every request) and varnish-specific implementations like listening on image style configuration changes and pushing them somehow to varnish would need to be done in e.g. the varnish module.

MiSc’s picture

Have now added basic support for this in the Varnish purger.