Custom metadata on bucket objects with the plugin-cloud-storage #8008
immotus
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The current implementation of
@payloadcms/plugin-cloud-storage
doesn't allow for users to configure custom metadata to be set on newly uploaded objects. The fix should be straightforward, as all functionality is pretty much there. The only thing that needs to be done is to allow users to specify custom metadata in their collection configuration settings.Reason:
For example, the default caching policy on GCP public objects is
Cache-Control: max-age=3600
, whereas for static objects, I'd rather set something likeCache-Control: public, max-age=15552000, must-revalidate
.For example:
The https://github.com/payloadcms/payload/blob/main/packages/plugin-cloud-storage/src/adapters/gcs/handleUpload.ts already set file metadata:
It would be great to allow the passing of custom metadata objects, e.g.:
It just needs to be integrated into the common API pattern to allow custom data to be passed on, like implemented in many other places.
Beta Was this translation helpful? Give feedback.
All reactions