- Merge request !13Draft: Issue #3552589: Added additional option to prevent flush original images → (Open) created by lpeidro
Drupal provides a mechanism to periodically clean up cached external images — removing both derivative (styled) and original versions to free up disk space.
This is useful to avoid accumulating unused image files.
However, when full-page caching or external page caches (e.g., Varnish, CDN, or Drupal’s internal page cache) are in use, a problem occurs:
The original image from the external source is downloaded and cached when the content is first rendered.
Later, if the cached originals and derivatives are deleted by the cleanup process, and the HTML page remains served from cache, users will still request image style URLs that no longer exist.
When Drupal receives the request for the missing image style, it attempts to regenerate it using the original file — but since the original has been deleted, this regeneration fails.
The missing original will only be recreated once Drupal re-renders the content (i.e., when the page cache is invalidated). Until then, the images remain broken.
This leads to broken image derivatives on cached pages when original cached external images are removed prematurely.
Result:
Add a configuration option to the image cleanup process (or the relevant service/module) allowing administrators to exclude original cached external images from deletion while still removing derivative images.
Possible technical solutions:
Benefits:
Active
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.