Fastly Pro Tips: VCL Configs We Use at Inellipse to Help Our Clients Cache Like Pros

As a proud Fastly partner, Inellipse leverages the full power of Fastly’s edge cloud platform to help our clients maximize performance and reliability. While Fastly offers robust caching out of the box, our experience shows that tailoring VCL (Varnish Configuration Language) unlocks even greater benefits — from faster load times to reduced origin load and better cache efficiency. Here are some of the key VCL configurations we implement to help our clients cache smarter:

  1. Custom TTLs Based on Content Type (Optimized for Streaming + Static Assets)
            
            vcl
            if (req.url.ext == "m3u8" || req.url.ext == "mpd") {
                set beresp.ttl = 60s;
            } else if (req.url.ext == "ts" || req.url.ext == "mp4") {
                set beresp.ttl = 1h;
            } else if (req.url.ext == "jpg" || req.url.ext == "css") {
                set beresp.ttl = 12h;
            }
            
            

    We assign different TTLs for streaming manifests, media segments, and static assets. This lets us balance freshness for real-time content like HLS or DASH streams, while maximizing cacheability for assets like images or CSS.

  2. Query String Normalization to Improve Cache Hit Ratio
        
    vcl
    if (req.url.qs ~ "utm_" || req.url.qs ~ "ref") {
        set req.url = regsub(req.url, "\\?.*$", "");
    }
        
    

    Query parameters like UTM tags can fragment your cache. We strip marketing noise from URLs so Fastly can serve more hits from a single cache key — a big win for performance and efficiency.

  3. We Build Fastly-Ready Websites : Unlike generic setups, we also build or maintain many of the websites we cache behind Fastly. That means we can design the frontend and backend logic with optimal caching in mind — from proper cache headers to smart surrogate key strategies — ensuring our VCL configs work hand-in-hand with the origin.
  4. Bonus: Cache Diagnostics with Custom Headers
        
    vcl
    set resp.http.X-Cache-Status = if (obj.hits > 0, "HIT", "MISS");
        
    

    For transparent performance insights, we inject a custom header showing whether the response was served from cache or not. This makes debugging and optimization much easier, both for us and our clients.

At Inellipse, these VCL tweaks are part of our mission to deliver fast, resilient, and scalable edge solutions — whether you’re streaming video, serving content globally, or running a complex web app.
👉 Want to learn how to make Fastly work harder for your platform? Let’s talk CDN strategy.

Got an idea? We can take it further.

Scroll