Hash Upload

Appends a content hash to uploaded filenames so CDN caching can run longer

Community 23 3/wk v1.0.0

Installation

pnpm add payload-hash-upload

About

Hash Upload gives each uploaded file a name that includes a short hash of its contents, so a file called chnux.png is saved as something like chnux.9cdfb439c7.png. Because the URL changes whenever the file changes, CDNs and browsers can cache the asset for a long time without serving stale copies after an edit.

The hash is added to uploads in the collections you choose, and you pick the hashing algorithm and how many characters to keep. Resized image versions are handled too, so each size gets a filename that follows the same pattern.

Package info

Package name
payload-hash-upload
Latest version
1.0.0
Unpacked size
7 kB
Weekly downloads
3
Last publish
Aug 18, 2021

More from jeanbmar

View profile

Sends uploaded files to Amazon S3 buckets instead of the server disk

Similar plugins

More in Storage

Lets editors crop uploaded images in a modal and generates resized variants per preset

Browse upload folders inside Payload's document drawers

Fetches missing media files from a production site during local development

Finds orphaned files and unreferenced documents, then deletes only what you approve

Builds sitemap.xml files from Payload content and keeps them fresh

Backs up and restores MongoDB data and media to Vercel Blob or S3 from the admin