---
title: "How to Set Up a CDN for Static Files: Step-by-Step Guide"
description: "Set up a CDN for static files step by step: origin choice, DNS and CNAME, cache rules, TLS, testing and purge workflow for your first deployment."
image: https://blog.blazingcdn.com/hubfs/Gemini-Blog/image-Nov-01-2026-07-55-14-1633-PM.jpeg
---

[![BlazingCDN](https://blog.blazingcdn.com/hubfs/Logo/blog-logo-w.png)](https://blog.blazingcdn.com?hsLang=en-us)

[📘Learn ▾](https://blog.blazingcdn.com/cdn-learn?hsLang=en-us)

[CDN Fundamentals](https://blog.blazingcdn.com/cdn-fundamentals?hsLang=en-us) [By Content Type](https://blog.blazingcdn.com/by-content-type?hsLang=en-us) [Advanced Concepts](https://blog.blazingcdn.com/advanced-concepts?hsLang=en-us) [Glossary](https://blog.blazingcdn.com/glossary?hsLang=en-us)

[⚡ Web Performance](https://blog.blazingcdn.com/web-performance?hsLang=en-us)

[🎬Video & Streaming ▾](https://blog.blazingcdn.com/video-streaming-cdn?hsLang=en-us)

[🔴 Live Streaming](https://blog.blazingcdn.com/live-streaming?hsLang=en-us) [📺 VOD & OTT](https://blog.blazingcdn.com/vod-ott?hsLang=en-us) [💰 Bandwidth & Costs](https://blog.blazingcdn.com/bandwidth-costs?hsLang=en-us)

[🏭 Other Industries ▾](https://blog.blazingcdn.com/cdn-industry-insights?hsLang=en-us)

[📺 Media & Broadcasting](https://blog.blazingcdn.com/media-broadcasting?hsLang=en-us) [💾 Software & SaaS](https://blog.blazingcdn.com/software-saas?hsLang=en-us) [🏗️ DevOps & Cloud Infra](https://blog.blazingcdn.com/devops-cloud-infra?hsLang=en-us) [📚 AdTech & Advertising](https://blog.blazingcdn.com/adtech-advertising?hsLang=en-us) [🎮 Gaming & Esports](https://blog.blazingcdn.com/gaming-esports?hsLang=en-us) [📱 Mobile Apps & Developers](https://blog.blazingcdn.com/mobile-apps-developers?hsLang=en-us) [🤖 AI & Machine Learning](https://blog.blazingcdn.com/ai-machine-learning?hsLang=en-us) [🏛️ Enterprise & Corporate](https://blog.blazingcdn.com/enterprise-corporate?hsLang=en-us) [📚 E-Learning & EdTech](https://blog.blazingcdn.com/e-learning-edtech?hsLang=en-us) [🏟️ Sports & Live Events](https://blog.blazingcdn.com/sports-live-events?hsLang=en-us)

[💰 Pricing & Costs ▾](https://blog.blazingcdn.com/cdn-pricing-and-cdn-costs?hsLang=en-us)

[Provider Pricing](https://blog.blazingcdn.com/provider-pricing?hsLang=en-us) [Cost Optimization](https://blog.blazingcdn.com/cost-optimization?hsLang=en-us) [Decision Support](https://blog.blazingcdn.com/decision-support?hsLang=en-us)

[⚡Compare ▾](https://blog.blazingcdn.com/cdn-comparison?hsLang=en-us)

[Provider Comparisons](https://blog.blazingcdn.com/provider-comparisons?hsLang=en-us) [Strategy Comparisons](https://blog.blazingcdn.com/strategy-comparisons?hsLang=en-us) [Ratings & Benchmarks](https://blog.blazingcdn.com/cdn-ratings-and-benchmarks?hsLang=en-us)

[📊 Benchmarks](https://blog.blazingcdn.com/cdn-ratings-and-benchmarks?hsLang=en-us)

[🔒 Security ▾](https://blog.blazingcdn.com/cdn-security?hsLang=en-us)

[Attack Protection](https://blog.blazingcdn.com/attack-protection?hsLang=en-us) [Encryption & Access](https://blog.blazingcdn.com/encryption-access?hsLang=en-us) [Video & DRM Security](https://blog.blazingcdn.com/video-drm-security?hsLang=en-us)

[📁 Case Studies](https://blog.blazingcdn.com/case-studies?hsLang=en-us) [🔌 Integrations](https://blog.blazingcdn.com/integrations?hsLang=en-us) [🛠️ Tools](https://blog.blazingcdn.com/cdn-tools?hsLang=en-us)

[Get Started](https://blazingcdn.com/sign-up-contact-form/)

[Learn](https://blog.blazingcdn.com/en-us/tag/learn) [Learn - CDN Fundamentals](https://blog.blazingcdn.com/en-us/tag/learn-cdn-fundamentals)

# How to Set Up a CDN for Static Files: Step-by-Step Guide

 Vadym Borovskyi  Nov 1, 2026, 8:57:26 PM

![](https://blog.blazingcdn.com/hubfs/Gemini-Blog/image-Nov-01-2026-07-55-14-1633-PM.jpeg)

To set up a CDN for static files, you need five things working together: a cacheable origin, a dedicated hostname pointed at the provider with a CNAME, cache rules per asset class, TLS at the edge, and a tested purge and rollback path. That is how to set up a CDN without surprises. For a typical site, expect 60 to 90 minutes of hands-on work plus one DNS TTL (300 seconds if you lower it first) for cutover. This guide covers eight numbered steps, a cache rule table by asset type, validation checks with expected values, and a diagnostics and rollback runbook.

Under the HTTP caching semantics in RFC 9111, a content-hashed file served with Cache-Control: public, max-age=31536000, immutable can stay at the edge for one year and never needs a purge, because every new build ships under a new URL. As of 2026, that single header on fingerprinted JavaScript, CSS and fonts is the main lever for reaching the common 95% cache hit ratio target for immutable assets. Short TTLs are reserved for the few files that change in place.

## **Prerequisites before you put static files behind a CDN**

Confirm these before you touch DNS. Each one prevents a specific failure later in this guide.

- **An HTTPS origin** that the CDN can reach: an object storage bucket, a web server, or a load balancer with a valid certificate.
- **Write access to DNS** for the zone that will hold the asset hostname, such as static.example.com.
- **A build pipeline that fingerprints filenames**, for example app.3f9a1c.js, so new content gets a new URL.
- **Control over origin response headers**, either in the web server config or in the object metadata.
- **A baseline** of current origin egress in TB per month, origin request rate, and time to first byte (TTFB) from two or three regions. Without it, you cannot prove the CDN did anything.

## **How to set up a CDN for static files in eight steps**

### Step 1: Classify assets by how often they change

Split every path into three classes. **Immutable** covers hashed JavaScript, CSS, fonts and source maps. **Low-mutation** covers images, PDFs and marketing files that change occasionally under the same name. **High-mutation** covers avatars, runtime configuration files and user-generated images. Why: one TTL for everything either serves stale files or wastes the cache, and the class decides both the header and the purge strategy.

### Step 2: Fix the origin headers first

The CDN can only be as consistent as the origin. Audit these headers on one file from each class:

- **Cache-Control:** public for shared assets. Remove private and no-store from anything static.
- **Vary:** Accept-Encoding only. Vary: Cookie or Vary: \* fragments the cache into one copy per visitor.
- **ETag and Last-Modified:** identical across every origin node, or revalidation will miss on every node switch.
- **Content-Encoding:** Brotli where the client accepts it, gzip as fallback, and never compress twice (origin and edge both compressing produces corrupted responses).

Why: identical URLs must return identical bytes regardless of which backend answers. Otherwise, the edge caches whichever variant it saw first.

### Step 3: Create the CDN zone

Create a pull zone with your origin hostname, keep the origin Host header the origin expects, and enable origin shield if the provider offers it. That collapses misses from many edge locations into one upstream fetch. Turn on request coalescing so a burst of simultaneous misses for one object produces a single origin request. On BlazingCDN, origin shield and request coalescing are included on every plan, and [**Anycast CDN zones for static files**](https://blazingcdn.com/anycast-cdn/) are configured together with an engineer, with onboarding taking about one hour.

### Step 4: Point DNS at the CDN with a CNAME

Lower the TTL on the existing record to 300 seconds a day ahead, then create the CNAME. The record looks like this:

> static.example.com. 300 IN CNAME YOUR\_ZONE\_HOSTNAME.

Replace YOUR\_ZONE\_HOSTNAME with the hostname the provider assigned to your zone. Why a subdomain: RFC 1034 forbids a CNAME at the zone apex, so serving assets from example.com itself needs provider-specific ALIAS or CNAME flattening. A dedicated asset hostname also makes rollback a one-record change.

### Step 5: Enable TLS at the edge

Issue a certificate for the asset hostname through the provider, using DNS or HTTP validation. Require TLS 1.3 where clients allow it, and redirect plain HTTP to HTTPS at the edge. Add HSTS only after the first full day of clean traffic. Why: an HSTS mistake is cached in browsers for the full max-age and cannot be purged.

### Step 6: Write cache rules per asset class

Map the classes from Step 1 to path rules. Prefer honoring origin Cache-Control and use edge overrides only where the origin cannot be changed.

| Asset type | Path pattern | Origin Cache-Control | Edge rule | Invalidation |
| --- | --- | --- | --- | --- |
| Hashed JS, CSS, source maps | /static/hashed/\* | public, max-age=31536000, immutable | Cache 1 year, ignore query strings | None: new build, new URL |
| Fonts | /fonts/\* | public, max-age=31536000, immutable | Cache 1 year, pass Access-Control-Allow-Origin | Rename on change |
| Images, PDFs, marketing files | /images/\* | public, max-age=86400, stale-while-revalidate=86400 | Cache 24 to 72 hours, optional WebP or AVIF | Path purge |
| Installers, archives | /downloads/\* | public, max-age=604800 | Cache several days, allow range requests | Versioned filenames, prewarm releases |
| Avatars, runtime config | /u/\*, /config/\* | public, max-age=60 to 300, with ETag | Short TTL, revalidate | Let TTL expire |

Only the low-mutation row ever needs a routine purge, because immutable files change URL and high-mutation files expire within five minutes.

### Step 7: Switch the application to the CDN hostname

Change the asset base URL in the build config so HTML references static.example.com. Add a preconnect resource hint for the asset hostname in the document head so the browser opens the TLS connection early. The trade-off: a path-based setup (example.com/static routed to the CDN) avoids the extra connection but couples CDN routing to application routing, which makes rollback harder.

### Step 8: Choose pull or prewarm for each path

Pull caching fits normal web assets: the first request per edge fills the cache. For large release artifacts that must be hot at launch, such as a 4 GB installer, push or prewarm through the provider API before you publish the link. Enable HTTP/3 if your provider supports it; most clients fall back to HTTP/2 cleanly when it is absent.

## **CDN setup guide: validation checks and expected results**

Validate from at least two regions before you announce the change. Use any HTTP client that shows response headers (browser developer tools, a command-line client, or a synthetic monitor) and check each item below:

1. **DNS:** a lookup of static.example.com returns your zone hostname as the CNAME target, not the origin IP.
2. **First request:** the provider cache status header reports MISS and the response carries your origin Cache-Control unchanged.
3. **Second request:** the status reports HIT and the Age header is above zero and increasing between requests.
4. **Compression:** a request sending Accept-Encoding: br returns Content-Encoding: br and Vary: Accept-Encoding.
5. **Fonts:** a cross-origin font request returns Access-Control-Allow-Origin matching your site.
6. **Range:** a request with a Range header for the first megabyte of a download returns status 206, not 200.
7. **TLS:** the certificate covers the asset hostname and the negotiated protocol is TLS 1.3.

If all seven pass, edge TTFB on cached objects should drop well below origin TTFB from distant regions. Record both, because that delta is your before-and-after evidence.

## **Diagnostics and rollback for a static CDN**

### How to read cache hit ratio and origin offload

A reasonable target is above 95% cache hit ratio for immutable assets and above 90% overall. Track it per path prefix, not as one global number, because a healthy hashed bundle can hide a broken image path. Pair it with origin offload (bytes served from cache divided by total bytes), edge error rate, and edge TTFB.

A worked example shows why a few points matter. At 40 TB of static egress a month, a 90% byte hit ratio leaves 4 TB coming from origin; at 97%, origin serves 1.2 TB. That 2.8 TB difference, at an assumed cloud egress rate of $0.05 to $0.09 per GB (our estimate, check your own bill), is $140 to $252 a month. Miss-driven origin requests also fall by 70%, from 10% of traffic to 3%, which matters more during a launch spike than the dollars do.

### Rollback runbook

1. Confirm the origin can absorb full traffic: compare its capacity with peak request rate from the baseline.
2. Change the CNAME for static.example.com back to the origin hostname. With a 300-second TTL, most resolvers follow within five minutes.
3. If the origin certificate does not cover the asset hostname, issue one before step 2, or the rollback becomes an outage.
4. Keep the CDN zone config in version control so you can restore it unchanged after the fix.

Rehearse this on staging before production. A rollback that has never run is a hypothesis.

### Purge workflow

Purge by path or by cache tag, never purge-all as a habit. A full purge empties every edge at once and sends the whole working set back to origin in minutes, a refill surge that can exceed the origin's normal load several times over. With fingerprinted URLs, routine deploys need no purge at all.

## **Common mistakes in CDN for static file delivery**

Most failures in CDN for static file delivery come from four causes: query strings that fragment the cache, a Vary header that varies on the wrong thing, origin headers that forbid caching, and missing CORS on fonts. Each one shows a distinct symptom in the headers, so diagnose from the response before changing provider settings.

- **Low hit ratio on hashed files.** Cause: tracking or cache-busting query strings create a new cache key per variant. Fix: ignore or normalize query strings on immutable paths.
- **Hit ratio collapses after login.** Cause: Vary: Cookie or a Set-Cookie header on static responses. Fix: strip cookies from asset responses at origin.
- **Every request is a MISS.** Cause: origin sends private or no-store. Fix: correct origin Cache-Control rather than forcing an edge override that hides the bug.
- **Fonts fail in one browser only.** Cause: missing Access-Control-Allow-Origin on the font response. Fix: add it at origin and include it in the cached object.
- **Garbled CSS after enabling compression.** Cause: double compression. Fix: compress in one layer only.
- **Stale images after a deploy.** Cause: in-place overwrite with a long TTL. Fix: version the filename or purge the exact path.

## **FAQ: Setting up a CDN for static files**

### How long does it take to setup a CDN for static files?

Plan for 60 to 90 minutes of configuration plus one DNS TTL for cutover. Most of the time goes into origin headers and cache rules, not the CNAME. Lowering the DNS TTL to 300 seconds a day earlier keeps cutover and rollback to roughly five minutes, and a staging rehearsal adds another hour that is worth spending.

### Should static files use a subdomain or the main domain behind a CDN?

A dedicated subdomain such as static.example.com is usually the better choice for static files on a CDN. It isolates cache rules, avoids cookies on asset requests, and makes rollback a single DNS change. A path on the main domain saves one connection, but it couples CDN routing to application routing and complicates troubleshooting.

### What Cache-Control header should hashed static files use on a CDN?

Hashed static files should use Cache-Control: public, max-age=31536000, immutable. The one-year max-age keeps them at the edge and in browsers, and immutable tells browsers to skip revalidation on reload. This is safe only when the filename changes whenever the content changes, which is what content hashing in the build pipeline guarantees.

### Do I need to purge the CDN after every static file deploy?

No, a CDN for static files does not need a purge on every deploy if filenames are fingerprinted. New builds reference new URLs, and old objects simply age out. Purges are needed only for files overwritten in place, such as marketing images, and those should be purged by exact path or tag, not with a purge-all.

### Why is my CDN cache hit ratio low for static files?

A low CDN cache hit ratio for static files usually comes from query-string variations, a Vary header on Cookie or User-Agent, or origin responses marked private or no-store. Break the ratio down by path prefix to find the offender, then inspect its response headers. Low-traffic long-tail files also miss more often, which origin shield helps reduce.

## **Run a per-path cache audit on your static CDN this week**

Export 24 hours of CDN logs and group them by path prefix. For each prefix, compute byte hit ratio, count distinct query strings per object, and list the Cache-Control and Vary values the origin returned. Any immutable prefix under 95%, or any object with more than a handful of query-string variants, is a rule to fix today. Then rehearse the rollback runbook on staging and time it. That audit pays off on any provider, including the one you run now.

If you are choosing a provider for high-volume static files, the [**BlazingCDN features for static file delivery**](https://blazingcdn.com/features/) page lists what every plan includes, from origin shield and request coalescing to purge, cache warm-up through the API, and Prometheus metrics.

Share: [f](https://www.facebook.com/sharer/sharer.php?u=https://blog.blazingcdn.com/en-us/how-to-set-up-a-cdn-for-static-file-delivery-step-by-step-guide) [in](https://www.linkedin.com/sharing/share-offsite/?url=https://blog.blazingcdn.com/en-us/how-to-set-up-a-cdn-for-static-file-delivery-step-by-step-guide) [𝕏](https://twitter.com/intent/tweet?url=https://blog.blazingcdn.com/en-us/how-to-set-up-a-cdn-for-static-file-delivery-step-by-step-guide&text=) [✉](mailto:?subject=%3Cspan%20id="hs_cos_wrapper_name"%20class="hs_cos_wrapper%20hs_cos_wrapper_meta_field%20hs_cos_wrapper_type_text"%20style=""%20data-hs-cos-general-type="meta_field"%20data-hs-cos-type="text"%20%3EHow%20to%20Set%20Up%20a%20CDN%20for%20Static%20Files:%20Step-by-Step%20Guide%3C/span%3E&body=https://blog.blazingcdn.com/en-us/how-to-set-up-a-cdn-for-static-file-delivery-step-by-step-guide)

![BlazingCDN](https://blog.blazingcdn.com/hs-fs/hubfs/Logo/blog-logo-w.png?height=24&name=blog-logo-w.png)

*Heavy traffic.*  
Light bill.

The CDN for video and large traffic

Their monthly bill vs ours

- 20 TBFastly $2,087**$92.50**
- 50 TBCDN77 $990**$215**
- 200 TBCloudFront $11,965**$765**

Published list prices, Aug 2026

[Calculate your cost](https://blazingcdn.com/cdn-cost-calculator/?utm_source=blog&utm_medium=sidebar&utm_campaign=blog_sidebar&utm_content=compare_calc)

## Related posts

[![](https://blog.blazingcdn.com/hubfs/Gemini-Blog/image-Nov-01-2026-07-25-16-1399-PM.jpeg)](https://blog.blazingcdn.com/en-us/cdn-live-events-achieving-sub-second-latency-sports-streams?hsLang=en-us)

Video - Video & Streaming

### [Sub-Second Live Sports Streaming: How to Cut Latency](https://blog.blazingcdn.com/en-us/cdn-live-events-achieving-sub-second-latency-sports-streams?hsLang=en-us)

As of 2026, the difference between a sports stream that feels live and one that feels delayed is mostly settled before ...

Nov 1, 2026, 8:27:22 PM [Read more](https://blog.blazingcdn.com/en-us/cdn-live-events-achieving-sub-second-latency-sports-streams?hsLang=en-us)

[![](https://blog.blazingcdn.com/hubfs/Gemini-Blog/image-Nov-01-2026-07-25-37-9991-PM.jpeg)](https://blog.blazingcdn.com/en-us/what-is-a-proxy-server-types-and-how-they-work?hsLang=en-us)

Learn

### [What Is a Proxy Server? Types and How They Work](https://blog.blazingcdn.com/en-us/what-is-a-proxy-server-types-and-how-they-work?hsLang=en-us)

What is a proxy server? A proxy server is an intermediary that accepts a client's request, applies policy, and then ...

Nov 1, 2026, 8:27:19 PM [Read more](https://blog.blazingcdn.com/en-us/what-is-a-proxy-server-types-and-how-they-work?hsLang=en-us)

[![BlazingCDN](https://blog.blazingcdn.com/hubfs/Logo/blog-logo-w.png)](https://blog.blazingcdn.com?hsLang=en-us)

[📘 Learn](https://blog.blazingcdn.com/cdn-learn?hsLang=en-us) [📊 Benchmarks](https://blog.blazingcdn.com/cdn-ratings-and-benchmarks?hsLang=en-us) [🎬 Video & Streaming](https://blog.blazingcdn.com/video-streaming-cdn?hsLang=en-us) [🏭 Industries](https://blog.blazingcdn.com/cdn-industry-insights?hsLang=en-us) [💰 Pricing & Costs](https://blog.blazingcdn.com/cdn-pricing-and-cdn-costs?hsLang=en-us) [⚡ Compare](https://blog.blazingcdn.com/cdn-comparison?hsLang=en-us) [🔒 Security](https://blog.blazingcdn.com/cdn-security?hsLang=en-us) [🛠️ Tools](https://blog.blazingcdn.com/cdn-tools?hsLang=en-us) [✍️ Publish with us](https://blog.blazingcdn.com/publish-with-us?hsLang=en-us)

in f 𝕏 ✉

 Copyright © BlazingCDN |. All rights reserved.

```json
{
  "@context" : "https://schema.org",
  "@id" : "https://blazingcdn.com/#organization",
  "@type" : "Organization",
  "description" : "High-volume CDN for video, live streaming, OTT/IPTV, software, games, SaaS and large-file delivery.",
  "logo" : {
    "@id" : "https://blazingcdn.com/#logo",
    "@type" : "ImageObject",
    "height" : 560,
    "url" : "https://blazingcdn.com/wp-content/uploads/2024/08/logo-560-560.png",
    "width" : 560
  },
  "name" : "BlazingCDN",
  "sameAs" : [ "https://www.linkedin.com/company/blazingcdn", "https://x.com/BlazingCdn", "https://www.reddit.com/r/BlazingCDN/", "https://www.wikidata.org/wiki/Q141711074" ],
  "url" : "https://blazingcdn.com/"
}
```

```json
{
  "@context" : "https://schema.org",
  "@id" : "https://blog.blazingcdn.com/#website",
  "@type" : "WebSite",
  "inLanguage" : "en-US",
  "name" : "BlazingCDN Blog",
  "publisher" : {
    "@id" : "https://blazingcdn.com/#organization"
  },
  "url" : "https://blog.blazingcdn.com/"
}
```

```json
{
  "@context" : "https://schema.org",
  "@id" : "https://blog.blazingcdn.com/en-us/how-to-set-up-a-cdn-for-static-file-delivery-step-by-step-guide#article",
  "@type" : "BlogPosting",
  "author" : {
    "@id" : "https://blog.blazingcdn.com/en-us/author/blazingcdn#person",
    "@type" : "Person",
    "description" : "Vadym Borovskyi is Chief Product and Marketing Officer at BlazingCDN, where he has led product strategy and growth since 2021. He has more than 11 years of experience in IT product management and B2B marketing. On this blog he writes about CDN pricing and egress costs, video and software delivery, cache configuration, and how teams evaluate and switch CDN providers. He is based in Warsaw, Poland.",
    "image" : "https://143144902.fs1.hubspotusercontent-eu1.net/hubfs/143144902/vadym-borovskyi.jpg",
    "jobTitle" : "Chief Product and Marketing Officer",
    "knowsAbout" : [ "Content Delivery Networks (CDN)", "CDN pricing", "Video streaming delivery", "Software and game distribution", "Cache optimization", "Product Management", "B2B Marketing", "Digital Marketing", "Pay Per Click Marketing (PPC)", "Google Ads", "Search Engine Marketing (SEM)", "Marketing Strategy", "Artificial Intelligence (AI)", "Cloud Management", "SaaS Development", "IT Consulting", "Computer Networking", "Project Management", "Startups" ],
    "name" : "Vadym Borovskyi",
    "sameAs" : [ "https://www.linkedin.com/in/axelt/" ],
    "url" : "https://blog.blazingcdn.com/en-us/author/blazingcdn",
    "worksFor" : {
      "@id" : "https://blazingcdn.com/#organization"
    }
  },
  "dateModified" : "2026-11-01T19:57:26Z",
  "datePublished" : "2026-11-01T19:57:26Z",
  "description" : "Set up a CDN for static files step by step: origin choice, DNS and CNAME, cache rules, TLS, testing and purge workflow for your first deployment.",
  "headline" : "How to Set Up a CDN for Static Files: Step-by-Step Guide",
  "image" : "https://143144902.fs1.hubspotusercontent-eu1.net/hubfs/143144902/Gemini-Blog/image-Nov-01-2026-07-55-14-1633-PM.jpeg",
  "inLanguage" : "en-us",
  "isPartOf" : {
    "@id" : "https://blog.blazingcdn.com/#website"
  },
  "mainEntityOfPage" : {
    "@id" : "https://blog.blazingcdn.com/en-us/how-to-set-up-a-cdn-for-static-file-delivery-step-by-step-guide",
    "@type" : "WebPage"
  },
  "publisher" : {
    "@id" : "https://blazingcdn.com/#organization"
  },
  "wordCount" : 2280
}
```

```json
{
  "@context" : "https://schema.org",
  "@id" : "https://blog.blazingcdn.com/en-us/how-to-set-up-a-cdn-for-static-file-delivery-step-by-step-guide#breadcrumb",
  "@type" : "BreadcrumbList",
  "itemListElement" : [ {
    "@type" : "ListItem",
    "item" : "https://blog.blazingcdn.com/en-us",
    "name" : "Blog",
    "position" : 1
  }, {
    "@type" : "ListItem",
    "item" : "https://blog.blazingcdn.com/en-us/how-to-set-up-a-cdn-for-static-file-delivery-step-by-step-guide",
    "name" : "How to Set Up a CDN for Static Files: Step-by-Step Guide",
    "position" : 2
  } ]
}
```

```json
{
  "@context" : "https://schema.org",
  "@id" : "https://blog.blazingcdn.com/en-us/how-to-set-up-a-cdn-for-static-file-delivery-step-by-step-guide#faq",
  "@type" : "FAQPage",
  "mainEntity" : [ {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "Plan for 60 to 90 minutes of configuration plus one DNS TTL for cutover. Most of the time goes into origin headers and cache rules, not the CNAME. Lowering the DNS TTL to 300 seconds a day earlier keeps cutover and rollback to roughly five minutes, and a staging rehearsal adds another hour that is worth spending."
    },
    "name" : "How long does it take to setup a CDN for static files?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "A dedicated subdomain such as static.example.com is usually the better choice for static files on a CDN. It isolates cache rules, avoids cookies on asset requests, and makes rollback a single DNS change. A path on the main domain saves one connection, but it couples CDN routing to application routing and complicates troubleshooting."
    },
    "name" : "Should static files use a subdomain or the main domain behind a CDN?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "Hashed static files should use Cache-Control: public, max-age=31536000, immutable. The one-year max-age keeps them at the edge and in browsers, and immutable tells browsers to skip revalidation on reload. This is safe only when the filename changes whenever the content changes, which is what content hashing in the build pipeline guarantees."
    },
    "name" : "What Cache-Control header should hashed static files use on a CDN?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "No, a CDN for static files does not need a purge on every deploy if filenames are fingerprinted. New builds reference new URLs, and old objects simply age out. Purges are needed only for files overwritten in place, such as marketing images, and those should be purged by exact path or tag, not with a purge-all."
    },
    "name" : "Do I need to purge the CDN after every static file deploy?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "A low CDN cache hit ratio for static files usually comes from query-string variations, a Vary header on Cookie or User-Agent, or origin responses marked private or no-store. Break the ratio down by path prefix to find the offender, then inspect its response headers. Low-traffic long-tail files also miss more often, which origin shield helps reduce."
    },
    "name" : "Why is my CDN cache hit ratio low for static files?"
  } ]
}
```