Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature request: (1) Cache invalidation endpoint and (2) immediate transformed image caching on upload #9

@ceramicwhite

Description

@ceramicwhite

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions