Fahad Anwar Muneer Contributor, CDNToolKit

Best CDN for APIs and Dynamic Content in 2026 (Compared)

Finding the best CDN for APIs and dynamic content starts with an uncomfortable fact: most of the traffic you care about cannot be cached the way an image can. A login call, a cart update, a personalized dashboard, and a payment confirmation all have to reach your servers. So when a provider promises to speed up your API, it may mean two very different things: avoiding your origin by serving a stored answer, or making the trip to your origin shorter and more reliable when a stored answer is not allowed. This guide separates the two, explains what HTTP actually lets a CDN cache, shows where caching quietly goes wrong for personalized responses, and compares seven providers using only what each documents about itself. It quotes no latency or throughput figures, because the numbers published for dynamic traffic are almost always the vendor’s own and are not comparable.

If your dynamic content is a WordPress site, our guide to the best CDN for WordPress covers that case specifically. For request fees and origin egress, see our pricing comparison, and for how footprint affects the distance to your users, see our global reach guide.

“Dynamic” is three different kinds of traffic

Three kinds of API traffic: public reads that can be cached, personalized reads that mostly cannot, and writes that are never cached
Three Kinds Of Dynamic Traffic

“Dynamic” is a catch-all for anything a server generates per request, but it hides very different cases, and a CDN treats each one differently.

Kind of trafficExamplesCan a shared cache store it?What a CDN can still do
Public, read-mostlyExchange rates, product catalog, feature flags, public search resultsUsually yes, with a short lifetimeCache briefly, absorb spikes, serve stale if the origin fails
Personalized readsAccount balance, cart contents, order statusGenerally no; the response depends on who askedTerminate connections nearby, reuse origin connections, pick better routes
Writes and actionsLogin, checkout, POST, PUT, PATCH, DELETENoThe same acceleration, plus pass-through with protection

Think of caching as a vending machine and acceleration as an express lane. A vending machine answers instantly because the answer was already in stock, but it only works for items many people want. An express lane cannot make a meal appear faster than the kitchen can cook it; it makes sure the order reaches the kitchen quickly and the dish arrives without detours. Most APIs need both, in proportion to how many of their endpoints fall in each row, and that proportion should drive your choice more than any feature list.

One consequence is worth stating early: acceleration cannot fix a slow origin. If a database query takes a second to run, a CDN can only shorten the travel around it.

What HTTP lets a CDN cache

Decision flow for whether a CDN can cache an API response, based on request method, Authorization header, Cache-Control directives, and cache key
Can A Shared Cache Store This Response?

The rules come from the HTTP standards, and providers’ documentation follows them closely. Responses to GET and HEAD are cacheable. A response to POST is cacheable only if it carries explicit freshness information and a Content-Location header matching the request URI, and even then it can only satisfy later GET or HEAD requests, according to RFC 9110. CDN documentation reflects this. Amazon CloudFront, for example, always caches responses to GET and HEAD, can optionally cache OPTIONS, and forwards POST, PUT, PATCH, and DELETE without caching them.

Two header rules catch API teams out. A response marked private tells a shared cache not to store it, and a shared cache must not reuse a response to a request carrying an Authorization header unless the response explicitly allows it, as RFC 9111 specifies. The standard also notes that a cookie on a response does not by itself stop caching, which is why the logic needs to be explicit; our WordPress guide walks through the same reasoning for HTML pages.

Two directives from RFC 5861 matter more for APIs than for websites. Stale-while-revalidate lets a cache serve a stale answer while it fetches a fresh one in the background, and stale-if-error lets it serve a stale answer when the origin fails; MDN documents both. Fastly’s documentation, for instance, describes honoring them from either Surrogate-Control or Cache-Control. Combine them with a lifetime of a few seconds on a hot public endpoint and a flood of identical requests becomes a trickle to the origin, a technique often called micro-caching.

GraphQL and the POST problem

GraphQL is the most common reason API traffic looks uncacheable. Servers following the GraphQL over HTTP approach support POST by default and may also support GET for queries, and the GraphQL project’s own performance guide says GET for query operations supports HTTP caching and CDN use, particularly when queries are replaced by hashed identifiers. Apollo’s documentation explains the practical catch: many CDNs only cache GET requests, which is why its automatic persisted queries send a short hash as a GET. Mutations stay on POST and are never cached.

A new method that may change this

In June 2026 the IETF published RFC 10008, which defines a QUERY method that is safe, idempotent, and cacheable but carries a request body, and requires the cache key to incorporate that body. It targets exactly the search and filter calls that are pushed through POST today, and InfoQ’s coverage calls it the first new standard HTTP verb in years. Adoption will take time, because a cache must read and normalize the body before it can check for a hit. We found no provider documentation describing body-keyed QUERY caching as of this writing, so confirm support with any provider before designing around it.

What a CDN can do when it cannot cache

A cache hit served from the edge versus an uncacheable request taking an optimized path through the CDN to the origin
Avoiding The Origin VS. Shortening The Trip

For the uncacheable majority, a CDN’s value is in the path, not the storage. Four mechanisms matter, and providers differ in how much of each they document:

  • Connections terminated near the viewer — Akamai’s IP Accelerator documentation notes that TCP performance suffers as the distance between connection endpoints grows, which is the problem that proxying near the user and optimizing the segment between servers is meant to address.
  • Warm connections to the origin — reusing established connections avoids repeated setup. CloudFront documents persistent connections with a configurable keep-alive timeout for custom origins, and Akamai’s best practices advise setting the origin timeout greater than the persistent connection timeout.
  • Route selection — Akamai’s documentation says BGP, the protocol that decides default routes, looks for the fewest hops without considering performance, so some providers test alternatives. Akamai’s SureRoute, Cloudflare’s Argo Smart Routing, and CloudFront’s backbone are covered in the provider section below.
  • Shielding and tiering — a middle cache layer means fewer locations contact your origin. Cloudflare’s reference architecture describes Tiered Cache as minimizing requests to customer origins, and Akamai’s best practices pair Tiered Distribution for cacheable content with SureRoute for non-cacheable content.

Treat any single “X percent faster for dynamic requests” claim with suspicion. Such figures depend on how far your users are from your origin, how congested the default path is, and how well your origin performs, none of which the provider controls or publishes for your case.

The personalization trap

The costliest mistake with dynamic content is not slowness but caching a response meant for one person and serving it to another. Providers document the hazard themselves:

  • Google Cloud CDN has a FORCE_CACHE_ALL mode that caches successful responses while ignoring private and no-store directives, and Google says to enable it only on backends that are not serving private or dynamic content.
  • Bunny warns in its request coalescing documentation not to use that feature with user-specific dynamic content, because personal information could be shared between users making simultaneous requests. Its Smart Cache option exists to limit caching to known static file types so dynamic content passes through.
  • Amazon CloudFront documents that if a cache policy’s minimum TTL is greater than zero, it will cache content for at least that long even when the origin sends no-cache, no-store, or private, so a minimum TTL on a personalized path overrides the origin’s own safeguard.
  • 5centsCDN documents an ignore-cookie option that ignores the Set-Cookie header from the origin so responses can be cached at the edge. It is useful for public content that sets a harmless cookie, and it carries the same risk if applied to personalized paths.
  • Fastly explains that request collapsing holds duplicate requests in a queue behind one origin fetch, and that if the response turns out to be uncacheable the queued requests cannot be satisfied from it, creating a bottleneck. Its advice is to skip the cache for requests you know are uncacheable.

The cache key is where most of this is decided. A key that omits something that changes the response, such as a tenant, language, or plan tier, will serve the wrong answer. A key that includes something unique to every request, such as a session ID or timestamp, will never produce a hit. CloudFront separates what goes into the cache key from what is merely forwarded to the origin, a useful pattern to look for in any provider. Four habits prevent most incidents:

  • Mark personal responses private or no-store at the origin, so the safe behavior does not depend on CDN configuration alone.
  • Key on what actually varies and nothing else, and remove headers such as Vary that fragment the cache for no benefit; Akamai’s API guidance lists removing Vary headers that hurt offload.
  • Never apply a blanket cache-everything rule to an API path without explicit exclusions for authenticated traffic.
  • Test with two accounts and confirm that one user’s response is never served to the other.

Rate limiting, bot management, and API protection also belong in an API CDN evaluation, but they are a separate comparison, and a CDN’s firewall cannot replace authorization checks in your own code.

How the leading CDNs compare for APIs and dynamic content in 2026

The seven providers below are grouped by how their documentation addresses uncacheable traffic and listed alphabetically within each group, so the order implies no ranking. Everything stated comes from the provider’s own documentation or product pages, which are linked. “Not described in the pages reviewed” means exactly that, not that a capability is absent.

Group 1: documented path optimization for uncacheable traffic

Akamai — a dedicated API product

Akamai’s API Acceleration documentation describes a product built for small, dynamic, high-volume, non-cacheable traffic, including telemetry and flash-crowd spikes. Its SureRoute documentation explains that it races three paths between edge and origin, reuses the winner for 30 minutes, and is designed primarily for non-cacheable content. Its best-practices page recommends a separate configuration for API traffic and normalizing cache keys that differ only in trivial values. Best fit: large public APIs with spiky traffic where route optimization matters and an enterprise contract is acceptable.

Amazon CloudFront — cache policies and a documented backbone

CloudFront caches GET and HEAD responses, optionally OPTIONS, and forwards other methods. A managed policy that disables caching is described by AWS as useful for dynamic content, and cache and origin request policies let you control the key separately from what is forwarded. AWS’s documentation overview says its backbone links with third-party networks to improve origin fetches and dynamic content acceleration. Best fit: APIs with AWS origins that want per-path cache policies.

Cloudflare — opt-in route optimization

Cloudflare’s cache documentation says dynamic content such as HTML is not cached by default, with Cache Rules available to change that, including rules that bypass the cache on a cookie. Its Argo Smart Routing add-on, billed by usage, optimizes the network path between its data centers and your origin, while Tiered Cache reduces the requests that reach the origin; its reference architecture notes that Tiered Cache topologies differ by plan, with some Enterprise-only. Best fit: global APIs that want opt-in path optimization alongside rule-based caching.

Group 2: caching controls and origin protection

5centsCDN — detailed cache controls, routing described at product level

5centsCDN’s SaaS page says API calls are routed through optimized global edge locations, but neither it nor the acceleration page says how. Its Developer Hub, a management API reference, documents caching controls: per-path edge, mid-tier, and browser durations with a no-cache mode, zone TTLs from 10 seconds, query-string and Vary cache-key handling, and stale serving. It does not state which HTTP methods are cached. Its network tiers shape the first hop. Best fit: smaller APIs with mostly North American or European users.

Bunny.net — safe-by-default caching with explicit overrides

Bunny’s Smart Cache restricts caching to known static file types, and its docs describe an Edge Rule override for caching API responses you know are safe. Its changelog lists varying the cache by request headers and per-request control of coalescing, which its docs note runs independently on each edge node and so does not guarantee a single origin request. Route optimization for uncacheable traffic is not described in the pages reviewed. Best fit: public, read-heavy endpoints where you can write clear cache rules.

Fastly — precise cache semantics

Fastly’s documentation covers request collapsing in detail, including the bottleneck it can create for uncacheable responses, and it honors stale-while-revalidate and stale-if-error through Surrogate-Control or Cache-Control. Its docs also caution that with shielding enabled, the requester reaching an edge POP may be another Fastly POP, so changing cache lifetimes can affect downstream caches. Route optimization for uncacheable traffic is not described in the pages reviewed. Best fit: teams that want exact control of cache behavior and will design for the collapsing caveat.

Google Cloud CDN — cache modes tied to its load balancer

Google’s cache modes default to caching static content automatically, require valid caching headers to cache dynamic content, offer a USE_ORIGIN_HEADERS mode that caches only when the origin sets them, and include the FORCE_CACHE_ALL mode Google warns against for private or dynamic backends. Route optimization for uncacheable traffic is not described in the pages reviewed. Best fit: APIs already served through Google Cloud’s load balancing that need explicit cache behavior.

The table summarizes how each documents caching and path optimization. It is not a ranking, and every row should be verified against the provider’s current pages.

ProviderCached by defaultPath optimization for uncacheable trafficWhat to verify
AkamaiPer configurationSureRoute; dedicated API AccelerationCache key and Vary handling
Amazon CloudFrontGET and HEAD (OPTIONS optional)AWS backbone; persistent connectionsCache policy and cookie/header keying
CloudflareStatic content only by defaultArgo Smart Routing (usage-billed add-on)Cache Rules and cookie bypass
5centsCDNPer zone and per-path rulesProduct-level claims; mechanism not documentedWhether routing helps your API; which methods are cached
Bunny.netKnown static types (Smart Cache)Not described in pages reviewedEdge Rule overrides; coalescing scope
FastlyPer HTTP semanticsNot described in pages reviewedCollapsing of uncacheable requests
Google Cloud CDNStatic content (default mode)Not described in pages reviewedCache mode; FORCE_CACHE_ALL risk

Sources: each provider’s own documentation, linked above. Providers change features often; verify before relying on any row. “Not described in pages reviewed” does not mean absent.

How to test a CDN for API traffic

A CDN that looks fast on a homepage can fail quietly on API paths. A short test plan covers the risks that matter:

  • Classify your endpoints first — sort them into public reads, personalized reads, and writes. Only the first group should ever be cached, and you should know its share of your traffic.
  • Check cache status on each class — request each public endpoint twice and confirm the second response is a hit, and confirm personalized and write endpoints never are.
  • Run the two-account test — call a personalized endpoint as user A, then as user B, and confirm B never receives A’s data, including under simultaneous requests if coalescing or collapsing is enabled.
  • Test stale behavior in staging — take the origin down briefly and confirm stale-if-error does what you expect, and that an error response is not cached and replayed to everyone afterwards.
  • Measure uncached requests separately — compare time to first byte at the median and the 95th and 99th percentiles for uncacheable calls, from the regions your users are in, apart from cache hits. This is where routing and connection reuse show up; see our global reach guide for choosing test regions.
  • Watch the origin — track origin request counts and open connections before and after, since offload and connection reuse are the point; our pricing comparison covers the request fees that can offset gains.
  • Try your GraphQL or search pattern — if you use GraphQL, confirm hashed queries sent as GET are cached as you expect, and ask each provider about QUERY support before planning around it.

Because API behavior shifts with every release and configuration change, a one-off test is not enough for a service that matters. If you want to track how your cached and uncached API paths hold up across the regions your users are in, over time and from real vantage points, independent monitoring is what we do at CDNToolkit, and teams comparing API delivery across CDNs can get in touch here.

The bottom line

The best CDN for APIs and dynamic content is the one whose strengths match the mix of traffic your API actually carries. If much of it is public and read-mostly, strong cache controls with stale serving and origin protection matter most, and Fastly, Bunny, and Google Cloud CDN document those controls clearly. If most of it is personalized or write traffic, documented path optimization matters more, which is where Akamai’s dedicated API product, Cloudflare’s Argo add-on, and CloudFront’s backbone are documented. 5centsCDN documents its cache controls in detail but describes API routing only at the product level, so test the routing on your own endpoints. Whatever you choose, classify your endpoints, key the cache on what varies, mark personal responses private, and verify with two accounts before launch. Keep an eye on RFC 10008, because it may eventually make a large class of search and filter calls cacheable.

Frequently asked questions

Can a CDN cache API responses?

Yes, for responses that are the same for many callers. GET and HEAD responses are cacheable under the HTTP standards, and public, read-mostly endpoints can be cached for a short time with stale serving to protect the origin. Personalized responses should not be shared-cached, and write operations are never cached.

Can a CDN cache POST requests?

Rarely. RFC 9110 allows a POST response to be cached only if it has explicit freshness information and a Content-Location header matching the request URI, and then only for later GET or HEAD requests. In practice, CDNs such as CloudFront forward POST without caching it. For read-style POST calls, such as GraphQL queries, consider GET with hashed queries, or watch for support of the new QUERY method.

Does a CDN speed up uncacheable requests?

It can, but not by avoiding the origin. A CDN can terminate connections near the user, reuse warm connections to the origin, and, with products such as Akamai’s SureRoute or Cloudflare’s Argo Smart Routing, choose better paths. It cannot make a slow origin respond faster, so measure uncached requests separately from cache hits.

Is it safe to cache authenticated API responses?

Only with care. A shared cache must not reuse a response to a request with an Authorization header unless the response explicitly allows it, and a response marked private must not be stored by a shared cache. Cache only responses that are genuinely the same for everyone who can make the request, key on everything that changes the response, and test with two accounts.

How do I cache GraphQL with a CDN?

Send read queries as GET using hashed or persisted queries, and keep mutations on POST. The GraphQL project’s performance guide says GET for queries supports HTTP and CDN caching, and Apollo’s automatic persisted queries send a short hash as a GET for this reason. Cache only public queries at first, with short lifetimes.

What is the HTTP QUERY method, and does my CDN support it?

QUERY, defined in RFC 10008 in June 2026, is a safe, idempotent, cacheable method that carries a request body, with the cache key required to include that body. It is meant for search and filter calls currently sent as POST. We found no provider documentation describing body-keyed QUERY caching as of this writing, so confirm with your provider before relying on it.

What is micro-caching, and is it worth it?

Micro-caching means caching a hot public endpoint for a very short time, typically seconds, so that many simultaneous identical requests share one origin fetch. Combined with stale-while-revalidate and stale-if-error from RFC 5861, it can protect an origin during spikes and outages. It is only appropriate for responses that are the same for everyone.