How to cut egress costs and speed up delivery using Gcore CDN and Object Storage
- By Gcore
- May 19, 2025
- 3 min read

If you’re serving static assets (images, videos, scripts, downloads) from object storage, you’re probably paying more than you need to, and your users may be waiting longer than they should.
In this guide, we explain how to front your bucket with Gcore CDN to cache static assets, cut egress bandwidth costs, and get faster TTFB globally. We’ll walk through setup (public or private buckets), signed URL support, cache control best practices, debugging tips, and automation with the Gcore API or Terraform.
Why bother?
Serving directly from object storage hits your origin for every request and racks up egress charges. With a CDN in front, cached files are served from edge—faster for users, and cheaper for you.
Lower TTFB, better UX
When content is cached at the edge, it doesn’t have to travel across the planet to get to your user. Gcore CDN caches your assets at PoPs close to end users, so requests don’t hit origin unless necessary. Once cached, assets are delivered in a few milliseconds.
Lower bills
Most object storage providers charge $80–$120 per TB in egress fees. By fronting your storage with a CDN, you only pay egress once per edge location—then it’s all cache hits after that. If you’re using Gcore Storage and Gcore CDN, there’s zero egress fee between the two.
Caching isn’t the only way you save. Gcore CDN can also compress eligible file types (like HTML, CSS, JavaScript, and JSON) on the fly, further shrinking bandwidth usage and speeding up file delivery—all without any changes to your storage setup.
Less origin traffic and less data to transfer means smaller bills. And your storage bucket doesn’t get slammed under load during traffic spikes.
Simple scaling, globally
The CDN takes the hit, not your bucket. That means fewer rate-limit issues, smoother traffic spikes, and more reliable performance globally. Gcore CDN spans the globe, so you’re good whether your users are in Tokyo, Toronto, or Tel Aviv.
Setup guide: Gcore CDN + Gcore Object Storage
Let’s walk through configuring Gcore CDN to cache content from a storage bucket. This works with Gcore Object Storage and other S3-compatible services.
Step 1: Prep your bucket
- Public? Check files are publicly readable (via ACL or bucket policy).
- Private? Use Gcore’s AWS Signature V4 support—have your access key, secret, region, and bucket name ready.
Gcore Object Storage URL format:
https://<bucket-name>.<region>.cloud.gcore.lu/<object>
Step 2: Create CDN resource (UI or API)
In the Gcore Customer Portal:
- Go to CDN > Create CDN Resource
- Choose "Accelerate and protect static assets"
- Set a CNAME (e.g.
cdn.yoursite.com) if you want to use your domain - Configure origin:
- Public bucket: Choose None for auth
- Private bucket: Choose AWS Signature V4, and enter credentials
- Choose HTTPS as the origin protocol

Gcore will assign a *.gcdn.co domain. If you’re using a custom domain, add a CNAME:
cdn.yoursite.com CNAME.gcdn.co
Here’s how it works via Terraform:
resource "gcore_cdn_resource" "cdn" {
cname = "cdn.yoursite.com"
origin_group_id = gcore_cdn_origingroup.origin.id
origin_protocol = "HTTPS"
}
resource "gcore_cdn_origingroup" "origin" {
name = "my-origin-group"
origin {
source = "mybucket.eu-west.cloud.gcore.lu"
enabled = true
}
}
Step 3: Set caching behavior
Set Cache-Control headers in your object metadata:
Cache-Control: public, max-age=2592000
Too messy to handle in storage? Override cache logic in Gcore:
- Force TTLs by path or extension
- Ignore or forward query strings in cache key
- Strip cookies (if unnecessary for cache decisions)
Pro tip: Use versioned file paths (/img/logo.v3.png) to bust cache safely.
Secure access with signed URLs
Want your assets to be private, but still edge-cacheable? Use Gcore’s Secure Token feature:
- Enable Secure Token in CDN settings
- Set a secret key
- Generate time-limited tokens in your app
Python example:
import base64, hashlib, time
secret = 'your_secret'
path = '/videos/demo.mp4'
expires = int(time.time()) + 3600
string = f"{expires}{path} {secret}"
token = base64.urlsafe_b64encode(hashlib.md5(string.encode()).digest()).decode().strip('=')
url = f"https://cdn.yoursite.com{path}?md5={token}&expires={expires}"
Signed URLs are verified at the CDN edge. Invalid or expired? Blocked before origin is touched.
Optional: Bind the token to an IP to prevent link sharing.
Debug and cache tune
Use curl or browser devtools:
curl -I https://cdn.yoursite.com/img/logo.png
Look for:
Cache: HIT or MISSCache-ControlX-Cached-Since
Cache not working? Check for the following errors:
- Origin doesn’t return
Cache-Control - CDN override TTL not applied
- Cache key includes query strings unintentionally
You can trigger purges from the Gcore Customer Portal or automate them via the API using POST /cdn/purge. Choose one of three ways:
- Purge all: Clear the entire domain’s cache at once.
- Purge by URL: Target a specific full path (e.g.,
/images/logo.png). - Purge by pattern: Target a set of files using a wildcard at the end of the pattern (e.g.,
/videos/*).
Monitor and optimize at scale
After rollout:
- Watch origin bandwidth drop
- Check hit ratio (aim for >90%)
- Audit latency (TTFB on HIT vs MISS)
Consider logging using Gcore’s CDN logs uploader to analyze cache behavior, top requested paths, or cache churn rates.
For maximum savings, combine Gcore Object Storage with Gcore CDN: egress traffic between them is 100% free. That means you can serve cached assets globally without paying a cent in bandwidth fees.
Using external storage? You’ll still slash egress costs by caching at the edge and cutting direct origin traffic—but you’ll unlock the biggest savings when you stay inside the Gcore ecosystem.
Save money and boost performance with Gcore
Still serving assets direct from storage? You’re probably wasting money and compromising performance on the table. Front your bucket with Gcore CDN. Set smart cache headers or use overrides. Enable signed URLs if you need control. Monitor cache HITs and purge when needed. Automate the setup with Terraform. Done.
Next steps:
Related articles
Subscribe to our newsletter
Get the latest industry trends, exclusive insights, and Gcore updates delivered straight to your inbox.





