Getting Started with Sirv CDN: A Complete Guide
Set up Sirv CDN for your website step by step. Upload, optimize, and deliver images through a global CDN with dynamic imaging via URL parameters.
What Is Sirv CDN?
Most CDNs cache your files and serve them from edge locations. Sirv does that too (24 global PoPs), but it also processes images on the fly. Resize, convert formats, apply effects, adjust quality. All through URL parameters.
Here’s how a request works:
- The browser hits the nearest CDN point of presence (PoP)
- If the exact variant is cached, it’s returned in about 25ms
- If not, the request goes to Sirv’s processing servers (around 55ms for a cached original, around 160ms for first-time processing)
- The processed image gets cached at the CDN edge for future requests
- Typical accounts see 80-90% cache hit ratios
The practical upshot: upload one master image, serve unlimited variations (different sizes, formats, effects) without pre-generating anything.
Step 1: Create Your Account
Sign up at sirv.com for a free account:
- 500 MB storage and 2 GB monthly CDN transfer
- Access to all features including dynamic imaging, 360 spin viewer, and image zoom
- 3 user accounts
- No credit card required
The free plan includes Sirv branding on interactive viewers (spins and zooms). Business plans starting at $19/month remove branding and bump limits to 5-500 GB storage with 20 GB transfer.
For evaluation, Sirv also offers a 30-day trial with 5 GB storage and all Business features unlocked.
Step 2: Upload Your Images
You’ve got several options here, depending on your workflow.
Web Interface (Dashboard)
The simplest approach. Drag and drop files in the Sirv dashboard. You can create folders, organize assets, and preview images directly in the browser.
REST API
Sirv’s REST API supports over 50 methods for file management. To upload programmatically:
# 1. Get an authentication token
curl -X POST https://api.sirv.com/v2/token \
-H "Content-Type: application/json" \
-d '{
"clientId": "YOUR_CLIENT_ID",
"clientSecret": "YOUR_CLIENT_SECRET"
}'
# 2. Upload a file
curl -X POST "https://api.sirv.com/v2/files/upload?filename=/images/product.jpg" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: image/jpeg" \
--data-binary @product.jpg
Create API credentials in your Sirv account under Settings > API. Tokens expire after 20 minutes by default (configurable up to 7 days).
Rate limits per hour:
| Plan | Total Requests | Search | Fetch |
|---|---|---|---|
| Free | 500 | 50 | 300 |
| Business | 7,000 | 1,000 | 2,000 |
| Enterprise | 14,000 | 2,000 | 4,000 |
S3-Compatible API
Sirv’s storage is S3-compatible, so you can use any AWS SDK or S3 tool you already know:
import boto3
s3 = boto3.client('s3',
endpoint_url='https://s3.sirv.com',
aws_access_key_id='YOUR_S3_KEY',
aws_secret_access_key='YOUR_S3_SECRET'
)
# Upload
s3.upload_file('product.jpg', 'YOUR_BUCKET', 'images/product.jpg')
# List files
response = s3.list_objects_v2(Bucket='YOUR_BUCKET', Prefix='images/')
for obj in response.get('Contents', []):
print(obj['Key'])
Your S3 bucket name, key, and secret are in Settings > S3. Both AWS Signature v3 and v4 are supported.
This is handy if you already have S3-based workflows or need to integrate with tools like CyberDuck, S3cmd, or Rclone.
FTP
Traditional FTP access is also available. Find your FTP credentials in Settings > FTP. All uploads are secured via SSL.
Remote Fetch
Sirv can pull images from external URLs automatically:
https://YOUR_ACCOUNT.sirv.com/fetch/https://example.com/image.jpg?w=800
This fetches the remote image, caches it on Sirv, and applies any dynamic imaging parameters you add. Useful for migrating from another CDN or processing third-party images.
Step 3: Dynamic Imaging via URL Parameters
This is the fun part. Once an image is on Sirv, append URL parameters to transform it on the fly.
Resizing
# Resize to 800px width (height auto-calculated)
/image.jpg?w=800
# Resize to fit within 800x600 box
/image.jpg?w=800&h=600
# Resize by longest side
/image.jpg?s=1000
# Force fill (crop to exact dimensions)
/image.jpg?w=800&h=600&scale.option=fill
# Generate a square thumbnail
/image.jpg?thumbnail=256
The default scale.option is fit, which maintains aspect ratio. Other options:
fill: crops to fill exact dimensionsignore: stretches/squishes to fitnoup: prevents upscaling
Format Conversion and Quality
# Force WebP output
/image.jpg?format=webp
# Optimal format (auto-detect best for browser)
/image.jpg?format=optimal
# Adjust JPEG quality (default 80)
/image.jpg?q=85
# PNG optimization
/image.png?png.optimize=true
# Lossy GIF compression
/animation.gif?gif.lossy=20
In practice, you rarely need format=webp because Sirv’s auto-format handles this automatically (more on that in Step 4).
Cropping
# Crop to specific region
/image.jpg?cw=500&ch=300&cx=100&cy=50
# Smart crop: auto-detect point of interest
/image.jpg?w=400&h=400&crop.type=poi
# Face detection crop
/image.jpg?w=400&h=400&crop.type=face
# Trim whitespace
/image.jpg?crop.type=trim
Effects and Adjustments
# Blur
/image.jpg?blur=15
# Sharpen
/image.jpg?sharpen=30
# Grayscale
/image.jpg?grayscale=true
# Sepia tone
/image.jpg?colortone=sepia
# Adjust brightness and contrast
/image.jpg?brightness=20&contrast=10
# Vignette effect
/image.jpg?vignette.value=40
Text and Watermark Overlays
# Add text overlay
/image.jpg?text=SALE&text.color=white&text.size=30&text.position=center
# Add watermark
/image.jpg?watermark=/logos/watermark.png&watermark.position=southeast&watermark.opacity=60
# Tiled watermark
/image.jpg?watermark=/logos/watermark.png&watermark.position=tile
Profiles (Saved Presets)
Instead of repeating long parameter strings, save them as profiles in your Sirv account:
# Apply a saved profile
/image.jpg?profile=product-thumbnail
# Override specific values
/image.jpg?profile=product-thumbnail&w=300
Create profiles in Settings > Profiles. These are especially useful for consistent batch processing across your entire catalog.
Step 4: Auto-Format Detection
Here’s where things get really nice. Sirv automatically detects browser capabilities using the HTTP Accept header and serves the best format:
- AVIF for browsers that support it (Chrome 85+, Firefox 93+)
- WebP as a fallback (Chrome, Firefox, Edge, Safari 14+)
- JPEG/PNG for older browsers
This happens transparently. No <picture> element or format parameters needed. Just reference the original image URL and Sirv handles the rest.
The savings are real:
- WebP: roughly 30-60% smaller than equivalent JPEG
- AVIF: roughly 40-50% smaller than equivalent JPEG
Quality defaults to 80% for standard displays and 60% for retina (DPR 1.5 or higher), which balances visual quality against file size. You can override these per-image with ?q=85 or globally in your account settings.
Step 5: Responsive Images
Want optimal performance across devices? You’ve got two approaches.
Automatic (Sirv JS)
The easiest way. Sirv’s JavaScript detects each image’s rendered size and requests the right dimensions:
<img class="Sirv" data-src="https://YOUR_ACCOUNT.sirv.com/image.jpg" alt="Product photo">
<script src="https://scripts.sirv.com/sirvjs/v3/sirv.js"></script>
This automatically handles:
- Viewport-based sizing: requests images matching the rendered width
- Retina detection: serves higher resolution for high-DPI screens
- Lazy loading: images load only when approaching the viewport
- Auto-format: serves WebP/AVIF based on browser support
- Placeholders: optional blur-up or dominant color while loading
Manual (srcset)
For more control, combine Sirv’s URL-based resizing with standard srcset:
<img
src="https://YOUR_ACCOUNT.sirv.com/image.jpg?w=800"
srcset="
https://YOUR_ACCOUNT.sirv.com/image.jpg?w=400 400w,
https://YOUR_ACCOUNT.sirv.com/image.jpg?w=800 800w,
https://YOUR_ACCOUNT.sirv.com/image.jpg?w=1200 1200w,
https://YOUR_ACCOUNT.sirv.com/image.jpg?w=1600 1600w
"
sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw"
alt="Product photo"
>
The advantage: you maintain one master image on Sirv and the CDN generates each size on demand. No need to upload multiple files.
Step 6: Set Up a Custom Domain
By default, images are served from YOUR_ACCOUNT.sirv.com. For branding and SEO, set up a custom domain like images.yoursite.com:
- Go to Settings > Custom Domain in your Sirv account
- Add your desired subdomain (e.g.,
images.yoursite.com) - Create a CNAME record in your DNS pointing to
YOUR_ACCOUNT.sirv.com - Sirv automatically provisions an SSL certificate
Custom domains are available on Business and Enterprise plans.
Step 7: Integrate with Your Platform
Sirv has plugins for the major e-commerce and CMS platforms.
WordPress / WooCommerce
Install the Sirv WordPress plugin to automatically serve all media library images through Sirv CDN. The plugin handles URL rewriting, lazy loading, and format optimization.
Shopify
The Sirv Shopify app adds 360 spin viewers, deep image zoom, and CDN delivery to your store.
Magento
The Sirv Magento extension replaces Magento’s media delivery with Sirv’s optimized CDN, adding 360 views and zoom to product pages.
Any Website
For any HTML site, replace image sources with Sirv URLs and add the Sirv JS script:
<!-- Replace static images -->
<img class="Sirv" data-src="https://YOUR_ACCOUNT.sirv.com/product.jpg" alt="Product">
<!-- Add Sirv JS once, before </body> -->
<script src="https://scripts.sirv.com/sirvjs/v3/sirv.js"></script>
Performance Tips
Preconnect for Faster Loading
Add DNS preconnect hints to your HTML <head> to shave 100-300ms off the first image request:
<link rel="preconnect" href="https://YOUR_ACCOUNT.sirv.com" crossorigin>
<link rel="preconnect" href="https://scripts.sirv.com" crossorigin>
Preload Critical Images
For above-the-fold hero images, use <link rel="preload"> to start downloading before the browser parses the page:
<link rel="preload" as="image" href="https://YOUR_ACCOUNT.sirv.com/hero.jpg?w=1200">
Use Profiles for Consistency
Create profiles for common transformations instead of repeating URL parameters:
product-card: 400px wide, 85% quality, face crophero-banner: 1600px wide, 90% qualitythumbnail: 150px square, 75% quality
This keeps your markup clean and makes it easy to adjust settings globally.
Monitor Cache Performance
Check your cache hit ratio in the Sirv dashboard under Usage. Aim for 80%+ hits. If your miss rate is high, it usually means:
- Too many unique image variations (simplify your URL parameters)
- Low-traffic images that expire from cache
- Recently uploaded or updated images (first request is always a miss)
What to Explore Next
Once you’re serving images through Sirv CDN, these are worth looking at:
- 360 Spin Viewer: upload product photos and create interactive spins
- Image Zoom: deep zoom with gigapixel support for product detail
- 3D Model Viewer: embed GLB/glTF models with AR support
- Video Streaming: HLS adaptive bitrate for product videos
- REST API Docs: full API reference for automation
Related Resources
The Image Performance Audit: A Step-by-Step Workflow for 2026
A practical, tool-driven workflow for auditing and fixing image performance issues. Covers Lighthouse, WebPageTest, Chrome DevTools, and CDN-based automation.
Implementing Responsive Images with srcset and Sirv
A hands-on tutorial covering srcset, sizes, picture elements, pixel density descriptors, and CDN-powered responsive images for optimal performance.