Allow generated cached images to be flushed using API call

Created on 4 February 2025, 3 months ago

Problem/Motivation

Once https://www.drupal.org/project/keepeek/issues/3503622 Add integration with Drupal Image Styles Active has landed, generated derivative images will be stored on the Drupal site. However, if the underlying asset is updated in Mastermedia, the Drupal site will continue to serve the cached assets.

Steps to reproduce

Add an asset to Drupal. Configure the Drupal media item to use 'Keepeek with Style' as the formatter.
Ensure a cached image is served and generated.
Update the asset in Keepeek.
Observe that the Drupal site will continue to serve the cached image regardless.

Proposed resolution

Add an endpoint that should accept an Asset ID and a method. e.g.
{
asset_id: 123,
method: purge
}
as a payload.
Use this data to find the Drupal media item(s) and flush the generated images.

This module gives a steer as to how this could be achieved.
https://git.drupalcode.org/project/flush_single_image/-/blob/8.x-2.x/src...
The module could be added as a dependency, but a new service added to the Keepeek module would be fine too, and prerferred.

Remaining tasks

https://www.drupal.org/project/keepeek/issues/3503622 Add integration with Drupal Image Styles Active
https://www.drupal.org/project/keepeek/issues/3503620 Store Keepeek Asset ID as hidden field value Active

User interface changes

n/a

API changes

New API endpoint. With authentication required.

Data model changes

n/a

Feature request
Status

Active

Version

1.1

Component

Code

Created by

🇮🇪Ireland alanburke

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

Comments & Activities

Production build 0.71.5 2024