ButterCMS CDN infrastructure
ButterCMS has served more than a billion requests. The decoupling of the frontend from the heavy backend makes ButterCMS inherently faster than traditional CMSs. The content API traffic is served through Fastly, a reliable and quick content delivery platform. Your media assets are stored and delivered via Amazon CloudFront, a low-latency CDN.Dual CDN architecture
ButterCMS employs a strategic dual-CDN approach:| Content Type | CDN Provider | Optimization |
|---|---|---|
| API Responses (JSON) | Fastly | Edge caching, low latency |
| Media Assets | Amazon CloudFront | Image optimization, global distribution |
How CDN caching works
Content delivery operates through a global CDN with 150+ edge locations. Read operations are cached for 20 days at edge locations by default, providing sub-100ms response times for cached content worldwide.Cache behavior
- Initial requests fetch content from the API and populate edge caches (~200-500ms)
- Subsequent requests serve from the nearest location (~50-100ms)
- Content updates automatically invalidate relevant cache entries globally
Response time comparison
| Scenario | Response Time | Notes |
|---|---|---|
| Cache hit (edge) | 50-100ms | Content served from nearest CDN location |
| Cache miss (origin) | 200-500ms | Content fetched from origin, then cached |
| Without CDN | 500-2000ms | Direct origin requests from distant locations |
Global edge locations
With third-party CDN caching, you can ensure that the same cache is served around the world irrespective of country or region. CDNs improve website performance by cascading data to locations closer to the user.Edge location benefits
Reduced Latency
Content is served from the geographically nearest location to each user
High Availability
Multiple edge nodes provide redundancy and failover capabilities
Bandwidth Savings
Origin servers handle fewer requests, reducing bandwidth costs
DDoS Protection
CDN absorbs and mitigates distributed attacks
Media delivery optimization
Image CDN features
ButterCMS media assets are delivered through CloudFront with automatic optimizations: Automatic Features:- WebP Conversion - Modern browsers receive WebP format automatically
- Compression - Images are compressed without visible quality loss
- Lazy Loading Support - URL-based transformations support progressive image loading (requires client-side implementation)
Responsive image example
Cache invalidation
Content changes (create, update, delete, and status changes) trigger multi-layer cache invalidation including:- Object cache - Individual cached items
- Serialized response cache - Pre-built API responses
- Global CDN cache - All edge location caches
Invalidation flow
Best practices for CDN performance
Optimize API requests
Optimize API requests
Smaller payloads cache more efficiently and transfer faster from edge locations. See:
- Query Optimization —
exclude_body,levels, and ordering - Pagination — page size and pagination strategies
- Filtering Requests — server-side filtering to reduce payload size
Leverage image transformations
Leverage image transformations
Resize images server-side instead of client-side:
Use appropriate caching headers
Use appropriate caching headers
When implementing your own caching layer:
Monitor CDN performance
Monitor CDN performance
Track CDN effectiveness:
- Cache hit ratio - Should be >90% for static content
- Edge response times - Should be
<100msfor cached content - Origin requests - Monitor for unexpected spikes
Security at the CDN level
DDoS protection
Distributed Denial of Service (DDoS) attacks can bring the whole application down if the architecture is not designed to prevent such a situation. ButterCMS protects users at the CDN level and also with load balancers and through AWS Shield. As your application becomes more popular, it can gain more attention from people with bad intentions. Applications based on a traditional monolithic architecture may be easily affected by DDoS attacks. With ButterCMS, your content is protected and will be available without interruptions thanks to modern cloud architectures.Data security
ButterCMS handles all aspects of security. The data centers used for storing and delivering your content are all ISO-27001 compliant. Your data is encrypted at rest using AES-256, and all API traffic is encrypted in transit using TLS 1.2+.Regional content delivery
How regional routing works
When a user requests content:- DNS Resolution - Request is routed to nearest edge location
- Edge Check - CDN checks if content is cached at that edge
- Cache Hit - Cached content served immediately (~50-100ms)
- Cache Miss - Request forwarded to origin, response cached at edge
Performance by region
| Region | Typical Cache Hit Response | Edge Locations |
|---|---|---|
| North America | 30-80ms | 40+ |
| Europe | 40-90ms | 30+ |
| Asia Pacific | 50-100ms | 25+ |
| South America | 60-120ms | 10+ |
| Middle East/Africa | 70-130ms | 10+ |