-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Two features that would greatly help my workflows where images are uploaded and replaced directly in S3 and/or when specific versions are needed immediately upon upload.
1. Add a public API endpoint to invalidate all caches for a specific image
When images are replaced directly in S3 (for example, to update or fix incorrectly uploaded media), Openinary can serve a stale cached version. Providing an API endpoint to invalidate all caches for a given original file path would let clients force Openinary to serve the new version immediately. Example usage:
await fetch(`${OPENINARY_API_URL}/invalidate/2016/ab130113.JPG`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${API_KEY}`
}
});2. Option to pre-generate/caching transformed images at upload via API
It would be helpful if, when uploading new images via the API, the client could specify transformation parameters (such as format, size, quality, etc.) and have Openinary immediately create and cache these transformed versions as part of the upload process. This would allow clients to serve different pre-optimized image versions right after upload, without waiting for the first request to each transformed version to trigger caching on-the-fly. Possible approaches could involve an extra field in the upload request listing transformations to cache immediately post-upload.