Do not try to download failed URLs repeatedly: attempt next time only after the local cache is rebuilt

Created on 2 November 2023, 8 months ago
Updated 24 June 2024, 1 day ago

Problem/Motivation

If the specified URL fails to download, and there is no fallback image set in module configuration, then Imagecache External formatters try to fetch the URL each time when the entity is rendered. This can happen quite often even with the same URL: the entity is rendered in teaser view mode, then in full view mode... and every time when the render cache is dropped.

Steps to reproduce

The most painful situation is when the URL to be downloaded is unavailable due to a timeout.

  1. Find such a URL.
  2. Set it as the link (or string) field value in an entity; and set this field to be formatted by one of the Imagecache External formatters.
  3. Save the entity (and wait till the first download attempt is performed by Imagecache External when the entity is rendered in its full view mode.
  4. Trigger another render in a different view mode, e.g. with teaser. You have to wait again until the download fails due to timeout.
  5. Re-save the entity without changing the URL. You have to wait again.

Proposed resolution

Track URLs which failed to download for some reason (403, 404, 5xx etc), and do not try to download them again until Imagecache External's file cache is reset.

Remaining tasks

User interface changes

API changes

Failed URLs which failed to download initially will only be tried to be downloaded again after rebuiliding Imagecache External's cache.

Data model changes

✨ Feature request
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡­πŸ‡ΊHungary huzooka Hungary πŸ‡­πŸ‡ΊπŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024