Fastly FAQs Asked in DevOps Interviews (2027)

48 Fastly interview FAQs for DevOps: service versions, VCL subroutines, Surrogate-Control, surrogate keys, soft purge, shielding, Compute, Terraform.

Oct 1, 2025 - 10:21
Nov 10, 2026 - 17:23
 0  96
Fastly FAQs Asked in DevOps Interviews (2027)

Fastly interview questions for DevOps roles focus on how the edge cloud caches and serves traffic: service versions and activation, VCL subroutines, TTLs and Surrogate-Control, surrogate keys and purging, shielding, Compute on WebAssembly, real-time logging, the Next-Gen WAF, and automating all of it with the API, CLI and Terraform. This FAQ has 48 questions with short, direct answers, grouped by level and followed by scenarios.

These are the questions DevOps and SRE interviewers ask when a team runs Fastly in front of its applications. For a longer question bank, see our 70+ Fastly interview questions, and for incident drills, the scenario-based Fastly questions. Answers were checked against the Fastly documentation in November 2026.

Key takeaways

  • Fastly configuration lives in versioned services. You clone a version, change it, validate it and activate it; rollback means activating an earlier version.
  • Fastly offers two platforms: VCL services (a Varnish-derived configuration language) and Compute services, which run WebAssembly built from Rust, JavaScript, Go or C++.
  • Know the cache TTL headers: Surrogate-Control is read by Fastly and stripped, Cache-Control also controls browsers.
  • Surrogate keys let you purge groups of objects. Soft purge marks content stale instead of deleting it; purge all cannot be soft.
  • DevOps teams manage Fastly as code through the Fastly API, the Fastly CLI and the fastly/fastly Terraform provider.

Quick reference

TopicWhat to remember
Purge one URLPOST /purge/{cached_url}
Purge by keyPOST /service/{service_id}/purge/{surrogate_key}
Bulk purge by keysPOST /service/{service_id}/purge
Purge allPOST /service/{service_id}/purge_all (never soft)
Soft purgeHeader Fastly-Soft-Purge: 1
Surrogate-Key limits1 KB per key, 16 KB per header value
Compute languagesRust, JavaScript, Go, C++
Local Compute testingfastly compute serve

Fastly basics: questions for freshers

1. What is Fastly?

Fastly is an edge cloud platform that provides content delivery (CDN), edge compute, security products such as the Next-Gen WAF, image optimisation and observability. Traffic is served from Fastly points of presence (POPs) close to users, which reduces latency and load on your origin servers.

2. What is a Fastly service?

A service is the unit of configuration: domains, origins (backends), caching rules, logging endpoints and custom code. Each service has a service ID and a series of numbered versions.

3. How do service versions work?

Active versions are locked. To change anything, you clone the active version, edit the clone, validate it and activate it. Rolling back means activating a previous version. This gives every change an audit trail.

4. What is a backend in Fastly?

A backend is an origin server Fastly fetches content from, such as a load balancer, an S3 bucket or a Kubernetes ingress. You can attach health checks, and with several backends you can use directors to balance between them.

5. What is VCL?

Varnish Configuration Language is a domain-specific language Fastly uses for VCL services. Fastly's version is derived from Varnish and extended with Fastly-specific functions and variables. You write logic inside subroutines that run at fixed points in the request lifecycle.

6. Name the main VCL subroutines and when they run.

vcl_recv runs when a request arrives, vcl_hash builds the cache key, vcl_hit and vcl_miss run on cache lookup results, vcl_pass runs for requests that bypass cache, vcl_fetch runs when the origin response arrives, vcl_error builds synthetic responses, vcl_deliver runs before the response goes to the client, and vcl_log runs after delivery for logging.

7. What is Fastly Compute?

Compute runs your own code at the edge as WebAssembly. Fastly's getting-started guide lists Rust, JavaScript, Go and C++ as supported languages. You scaffold with fastly compute init, test locally with fastly compute serve, and deploy with fastly compute deploy (or publish, which builds and deploys).

8. What is a cache hit, miss and pass?

A hit is served from Fastly's cache. A miss is not in cache, so Fastly fetches from origin and may store the result. A pass bypasses the cache entirely, typically for personalised or authenticated responses.

9. How can you see whether a response was a hit?

Fastly adds response headers such as X-Cache (HIT or MISS) and X-Served-By (the cache node). Sending a Fastly-Debug request header returns extra debug headers, including surrogate keys that Fastly normally strips.

10. What is a POP?

A point of presence is a Fastly data centre location with cache servers. Requests are routed to a nearby POP, which serves cached content or fetches from origin.

11. What is TLS termination at the edge?

Fastly accepts HTTPS from clients using certificates for your domains, decrypts at the POP, and connects to origin over its own TLS connection. You manage certificates through Fastly's TLS products, either Fastly-managed or uploaded.

12. Which tools do DevOps engineers use to manage Fastly?

The web control panel for exploration, the Fastly API for automation, the Fastly CLI for scripting and Compute development, and Terraform with the fastly/fastly provider for configuration as code.

Caching, purging and configuration: 2 to 5 years

13. How does Fastly decide how long to cache an object?

Fastly reads Surrogate-Control: max-age first, then Cache-Control: s-maxage, then Cache-Control: max-age, then Expires. If none is present, a default TTL applies. You can override any of this in VCL by setting beresp.ttl in vcl_fetch.

14. Why use Surrogate-Control instead of Cache-Control?

Fastly reads Surrogate-Control and strips it before the response reaches the browser. That lets you cache at the edge for a long time while sending browsers a short Cache-Control lifetime, so a purge at Fastly takes effect quickly for users.

15. What are surrogate keys?

Tags on cached objects, sent in a space-separated Surrogate-Key response header from origin or set in vcl_fetch. One key can tag many objects and one object can carry many keys, so you can purge "all pages showing product 123" with a single request. Keys are case-sensitive, limited to 1 KB each and 16 KB per header.

16. What is the difference between a hard purge and a soft purge?

A hard purge removes the object, so the next request goes to origin. A soft purge, requested with Fastly-Soft-Purge: 1, marks the object stale. Fastly can then serve the stale copy while it revalidates, or if origin fails, which protects origin from a stampede.

17. Can you soft purge everything?

No. Purge all always invalidates everything immediately. Fastly's docs suggest tagging every object with a constant surrogate key such as all and soft purging that key instead.

curl -X POST \
  -H "Fastly-Key: $FASTLY_API_TOKEN" \
  -H "Fastly-Soft-Purge: 1" \
  "https://api.fastly.com/service/$SERVICE_ID/purge/all"

18. How do stale-while-revalidate and stale-if-error help?

These Cache-Control or Surrogate-Control directives let Fastly serve a stale object while it fetches a fresh copy in the background, or serve stale content when origin returns errors or is down. They improve both latency and resilience.

19. What is request collapsing?

When many clients request the same uncached object at once, Fastly sends one request to origin and holds the others until the response arrives. This prevents a thundering herd on origin after a purge or for new content.

20. What is shielding?

Shielding designates one POP as the shield for a backend. Other POPs fetch from the shield instead of from origin, so origin sees far fewer requests and the cache hit ratio rises. You pick a shield POP close to the origin.

21. How do you change the cache key?

In VCL, edit vcl_hash or normalise the request in vcl_recv, for example by removing tracking query parameters or sorting query strings. A cleaner cache key raises hit ratio. Use the Vary header carefully, because each variation is stored separately.

sub vcl_recv {
  #FASTLY recv
  # Strip common tracking parameters before lookup
  set req.url = querystring.regfilter(req.url, "^(utm_.*|gclid|fbclid)$");
  return(lookup);
}

22. What are edge dictionaries and config stores?

Key-value data that edge code reads without a service version change. VCL services use edge dictionaries; Compute services use config stores. Typical uses are feature flags, redirect maps and allow lists. For larger or frequently written data, Fastly offers a KV Store.

23. What is real-time log streaming?

Fastly can stream request logs to endpoints such as Amazon S3, Google BigQuery, Datadog, Splunk, Elasticsearch or an HTTPS endpoint. You define a log format and the endpoint in the service configuration, and logs are sent from vcl_log in VCL services.

24. How do you monitor a Fastly service?

Use the real-time and historical stats in the control panel and API (requests, hit ratio, errors, bandwidth, origin latency), stream logs to your log platform, and export metrics to tools such as Prometheus or Datadog. Alert on hit ratio drops and 5xx rates from origin.

25. How do you manage Fastly with Terraform?

Use the fastly/fastly provider with fastly_service_vcl or fastly_service_compute resources. Terraform creates a new service version on each change and can activate it. Keep VCL snippets and dictionaries in the same repository and run plan in CI.

resource "fastly_service_vcl" "web" {
  name = "web-prod"

  domain {
    name = "www.example.com"
  }

  backend {
    name    = "origin"
    address = "origin.example.com"
    port    = 443
    use_ssl = true
  }

  force_destroy = false
}

26. What are VCL snippets?

Small blocks of VCL inserted into a specific subroutine of Fastly's generated VCL. They are easier to manage than a full custom VCL file. Dynamic snippets can be updated through the API without a new service version.

27. How do you safely test a configuration change?

Clone the active version, make the change, validate it, and test on a staging service or a separate domain first. For Compute, test locally with fastly compute serve. Activate during a quiet period and watch error rates and hit ratio; roll back by activating the previous version.

28. How do you handle redirects at the edge?

In VCL, match the URL in vcl_recv, trigger an error with a custom status, and build the redirect response in vcl_error. Large redirect maps belong in an edge dictionary. In Compute, return a response with the Location header from your code.

29. How do you route requests to different backends?

Set req.backend in vcl_recv based on the path, host or a header, or use conditions in the control panel. Directors spread traffic across several backends with random, hash or fallback policies.

30. How do health checks work?

Fastly polls a URL on each backend at an interval and marks it healthy or sick based on the response. Directors skip sick backends, and with stale-if-error you can keep serving cached content when all backends fail.

Security and senior questions

31. What is the Fastly Next-Gen WAF?

Fastly's web application firewall product, which came from Fastly's acquisition of Signal Sciences in 2020. It inspects requests for attacks such as SQL injection and cross-site scripting, and can be deployed on the edge or as an agent near the application.

32. How does Fastly help with DDoS?

The global network absorbs volumetric attacks across many POPs. Caching keeps origin load low. You can add rate limiting at the edge, block by IP or geography in VCL, and use the WAF for application-layer attacks.

33. How do you protect the origin from direct traffic?

Allow only Fastly's IP ranges (published through the Fastly API) at the origin firewall, require a shared secret header added by Fastly, or use mutual TLS between Fastly and origin. Otherwise attackers can bypass the edge.

34. How do you store API tokens for automation?

Create scoped API tokens per pipeline with the least permissions needed, store them in your secrets manager or CI secret store, rotate them, and never put them in Terraform code or VCL.

35. How would you design a multi-CDN setup with Fastly?

Use DNS-based traffic steering between CDNs, keep caching rules consistent, use the same origin shield strategy, and test failover. Our Akamai interview questions help if the second CDN is Akamai, and our CloudFront guide covers the AWS option.

36. When would you pick Compute over VCL?

Pick Compute when you need general-purpose logic: calling several backends, transforming responses, complex authentication, or code shared with other systems in Rust, JavaScript, Go or C++. VCL is simpler for caching rules, header manipulation and routing.

37. How do you build CI/CD for a Compute service?

Build and test the WebAssembly package in CI, run local integration tests with fastly compute serve, then deploy to a staging service with fastly compute deploy using a scoped token. Promote to production after checks pass.

38. How do you raise cache hit ratio?

Normalise the cache key, remove unnecessary Vary headers and cookies on cacheable responses, increase TTLs and purge by surrogate key instead of expiring early, enable shielding, and serve stale while revalidating.

39. How do you cache content that varies per user?

Cache the shared part of the page and fetch personalised fragments separately, or vary on a small normalised header such as a device class instead of the full user agent. Never cache responses that set session cookies.

40. How do you audit who changed a Fastly service?

Service version history shows each version and its comment. Fastly also records account events. Managing configuration only through Terraform or the API from CI gives you Git history as the main audit trail.

Scenario questions

41. After a deploy, users see old CSS.

Check whether the file name is versioned. If not, purge the URL or its surrogate key. Long term, use content-hashed file names so new deploys never collide with cached assets.

42. Origin load spiked after a purge all.

Every object became a miss at once. Use soft purges by surrogate key instead, enable shielding, and rely on request collapsing. Reserve purge all for emergencies.

43. Hit ratio dropped from 90 percent to 40 percent overnight.

Compare service versions for recent changes, check whether origin started sending Set-Cookie, Cache-Control: private or a new Vary header, and look for new query parameters in logs that fragment the cache key.

44. Users in one region report errors, others do not.

Check the Fastly status page and per-POP stats, test with a request that shows X-Served-By, and check whether that region uses a different backend or shield that is unhealthy.

45. A new service version broke the site.

Activate the previous version immediately to restore service, then diff the two versions to find the faulty change. Add a staging step and automated smoke tests before the next activation.

46. A bot is hammering the login endpoint.

Apply edge rate limiting on that path, enable WAF rules for credential stuffing, and log blocked requests. Coordinate with the application team on account lockout and MFA.

47. Compute code works locally but fails in production.

Check that backend names, config stores and secrets exist in the production service, read the logs from your logging endpoint, and confirm the package was built for the version you deployed.

48. Origin is down for maintenance.

If stale-if-error is set, Fastly keeps serving cached content. For uncached pages, return a synthetic maintenance page from vcl_error or from Compute code, with a short TTL.

How to prepare

Create a free Fastly account, put a service in front of a test origin, and practise purges, surrogate keys and version rollback. Manage the same service with Terraform. For general CDN and DevOps rounds, our 200+ DevOps interview questions fill in the CI/CD and cloud basics, and the DevOps training course covers CI/CD, Terraform and monitoring in Pune (Kharadi) and live online.

FAQ

Do I need to know VCL for a Fastly DevOps interview?

Yes, at least the subroutines, how TTLs are set in vcl_fetch and how to change the cache key. Many teams still run VCL services alongside Compute.

Which languages does Fastly Compute support?

Fastly's getting-started guide lists Rust, JavaScript, Go and C++. Code compiles to WebAssembly and runs on Fastly's edge.

What is the difference between Surrogate-Control and Cache-Control?

Fastly reads Surrogate-Control and removes it before the response reaches the browser. Cache-Control is also used by browsers and other caches.

Can purge all be a soft purge?

No. Purge all always invalidates everything immediately. Tag all objects with a common surrogate key and soft purge that key instead.

How do I roll back a Fastly change?

Activate the previous service version. Active versions are locked, so the earlier configuration is still intact.

Can Terraform manage Fastly?

Yes. The fastly/fastly provider manages VCL and Compute services, backends, domains, logging and dictionaries, and creates a new version for each change.

What is shielding in Fastly?

A POP chosen as an intermediate cache for a backend. Other POPs fetch from it instead of from origin, which cuts origin load.

Official references

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.