Skip to main content

CDN & performance

All stored files in your application are available over the ButterCMS CDN, making it fast for your customers to download those assets as needed.

CDN benefits

  • Global Distribution - Content served from edge locations worldwide
  • Automatic Caching - Reduced load times for repeat visits
  • High Availability - Reliable image delivery
  • SSL/HTTPS - Secure image serving

CDN URL structure

Example:

Understanding CDN URLs

All files you upload to your ButterCMS account will have a ButterCMS CDN URL. Files in the Media Library are assigned a random CDN URL slug so that each asset has its own unique URL.

Example URLs

A URL on your site (e.g. https://mywebsite.com/HeadlessCMSvsTraditionalCMS.pdf) cannot link to a file in ButterCMS (e.g. https://cdn.buttercms.com/Cw5z1qzSq5qtVMCbUDwQ) since that asset resides on your domain. If you want to redirect a URL to an asset stored in your ButterCMS media library, you’ll need to set up a URL route in your web application that is hardcoded to load the asset from ButterCMS.

Setting up custom URL redirects

If you want to set up multiple redirects for ButterCMS media assets, follow these steps:

Step 1: create a resources Collection

Create a “Resources” Collection in ButterCMS with:
  • A Name short text field
  • A Resource media field

Step 2: add a route in your application

Create a route that matches your desired URL pattern, for example:

Step 3: query the Collection

Look up the resource by slug (or name) in your Resources collection.

Step 4: proxy or redirect to the asset

Redirect users to the CDN URL (recommended), or proxy the response through your app if you need to add headers or access controls.

Image URL transformations

ButterCMS integrates with Filestack’s Image API, allowing you to transform images by modifying the URL. This gives you powerful optimization capabilities without changing the original file.

URL structure

Processing tasks can be added to any CDN URL. Tasks follow this structure:
Multiple tasks can be chained by separating them with forward slashes:

Common transformations

To preserve aspect ratio, specify only width or height (for example, resize=width:800). If you set both width and height, the image is resized to those exact dimensions.

Examples

Original URL:
Resize to 300px height:
Resize to 800px width:
Multiple transformations:
Using URL transformations creates a new optimized version of the image on the CDN, improving page load times without modifying your original file.
For more advanced image transformations, refer to the Filestack Processing API documentation.

Best practices

Cache Transformed Images

URL transformations are cached on the CDN, so subsequent requests are fast

Responsive Images

Use URL parameters to serve different image sizes for different screen sizes

Original Backup

Your original files are always preserved; transformations create new versions

Descriptive Names

Use SEO-friendly slugs in your Resources collection for readable URLs