Skip to content

Add UI to invalidate cache for individual images directly from WordPress #1069

@kushh23

Description

@kushh23

Problem

Currently, when a user wants to clear the cache for a specific updated image from the WordPress dashboard, their only option is to regenerate the entire Optimole image cache. Flushing the entire cache for a single image update is highly inefficient and disruptive for high-traffic sites. While there is an API available to invalidate specific assets, it is inaccessible to non-technical WP admins.

Desired Behavior

Provide a setting or action within the WordPress dashboard to dump the cache for a single image or a small selection of images. This could be exposed as a bulk action/row action in the native WP Media Library or an input field in the Optimole settings where an admin can paste specific URLs to clear.

Acceptance Criteria

  • Provide a UI control within the WordPress admin (e.g., in Media Library and/or Optimole settings) to trigger cache invalidation for specific images.
  • The action securely triggers the existing POST /api/optml/v2/cache/invalidate/asset backend endpoint using the site's API credentials.
  • An admin notice clearly confirms whether the single-image cache was successfully refreshed or if it failed.

Customer Context

An agency partner managing high-traffic sites requests a targeted way to clear cache for individual images via the WordPress backend. Regenerating the entire cache is too heavy-handed, and their team cannot easily use the Optimole REST API.

https://secure.helpscout.net/conversation/3293257808/487980

Metadata

Metadata

Assignees

No one assigned

    Labels

    customer reportIndicates the request came from a customer.
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions