Codeinwp / Codeinwp/optimole-wp
Add UI to invalidate cache for individual images directly from WordPress
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 72
- Forks
- 14
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 15
Description
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/assetbackend 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing WordPress dashboard cache controls and the POST /api/optml/v2/cache/invalidate/asset endpoint. Determine how a Media Library action or Optimole settings input can submit selected image URLs using the site's API credentials. Done means targeted invalidation works and the admin receives a clear success or failure notice.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- api, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100