Media Library
The Media Library is a central file manager built directly into the Mincemeat CMS. All uploaded assets are stored securely in cloud object storage and served with high-performance on-demand transformations directly from edge locations.
Before you start
- You must have the necessary access permissions (Editor or Administrator role) to upload or manage assets.
- Your files must be under the 25 MB upload limit.
Upload workflow and details
When you upload a file via the dashboard or the media REST API:
- Magic bytes verification: The system sniffs the file's binary stream (magic bytes) to verify its actual MIME type. This prevents malicious files from masquerading as safe file extensions.
- SHA-256 deduplication: The system computes a SHA-256 hash of the uploaded stream. If the hash matches an asset already in your project's library, the system skips uploading duplicate bytes and associates the existing asset with your collection.
- Metadata tracking: Asset properties (file size, width, height, mime type, hash) are saved to your dedicated database for quick lookup.
On-demand image variants
For images, Mincemeat uses an edge-based processing engine compiled from Rust to transform images on the fly.
To request a custom variant, append query parameters to the file retrieval URL:
- Custom Subdomain:
GET https://{project-slug}.cms.mincemeat.app/v1/media/{id}/file?w=800&h=600&fit=cover&fmt=webp&q=85 - Path Fallback:
GET https://cms.mincemeat.app/v1/{project-slug}/media/{id}/file?w=800&h=600&fit=cover&fmt=webp&q=85
Query parameters
w(width): Requested width in pixels.h(height): Requested height in pixels.fit: How the image fits the dimensions. Options:cover: Crops the image to fit the aspect ratio (default).contain: Resizes the image to fit entirely within the box without cropping.fill: Stretches the image to match the dimensions.
fmt(format): Output image format. Options:webp(recommended),avif,jpeg,png.q(quality): Compression quality from1(smallest file size) to100(highest quality). Defaults to85.
CPU protection guardrails
Because edge-based processing runs on constrained serverless execution threads, Mincemeat enforces safety caps to prevent CPU limits from being exceeded:
Megapixel Limit
Source images used for on-demand transformations must not exceed 8 megapixels (8 MP) (for example, a 2000 x 4000 image).
- If you attempt to transform an image larger than 8 MP on the fly, the request fails with a
202 Acceptedstatus returning avariant_too_largecode indicating that the variant should be pre-generated by the worker queue. - For images larger than 8 MP, a background worker automatically pre-generates common default sizes (small, medium, large) and saves them in secure cloud storage, or serves the original file directly.
Performance and caching
Once an image variant is generated, it is:
- Written back to cloud storage under
variants/{w}x{h}_{fit}.{ext}. - Cached in the global edge CDN cache. Subsequent requests for the same dimensions are served instantly from the edge cache without running any image processing compute.
