<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "What is a domain shard?", "acceptedAnswer": { "@type": "Answer", "text": "A domain shard is one of multiple asset hostnames you use to serve files. Instead of sending everything from www.example.com, assets are split across hosts like static1.example.com and static2.example.com." } }, { "@type": "Question", "name": "Can you give a quick domain sharding example?", "acceptedAnswer": { "@type": "Answer", "text": "Yes. Page HTML loads from www.example.com, images from img.example-assets.com, and CSS/JS from static.example-assets.com. This clean split requires minimal code changes." } }, { "@type": "Question", "name": "Does domain sharding help on mobile?", "acceptedAnswer": { "@type": "Answer", "text": "Sometimes. On modern mobile browsers using HTTP/2 or HTTP/3, one hostname is typically faster due to fewer DNS/TLS handshakes. Older devices or slow networks may benefit from a second host for image-heavy pages." } }, { "@type": "Question", "name": "Is domain sharding bad for SEO?", "acceptedAnswer": { "@type": "Answer", "text": "Not by itself. SEO benefits come from speed and reliability. Keep HTTPS, caching, and headers consistent across hosts and ensure assets load without errors." } } ] } </script>
Glossary
Domain Sharding

Domain Sharding

Alex Khazanovich

Pages feel slow when the browser has to queue many files behind a few network lanes. Domain sharding tries to add more lanes by spreading requests across multiple hostnames. It sounds clever. 

Sometimes it is. Other times it hurts more than it helps. 

What Domain Sharding Means

Domain sharding is the practice of serving static files from more than one hostname so the browser can open more parallel connections. For example, images might come from static1.example.com and scripts from static2.example.com, while the page HTML still loads from www.example.com. Each hostname is a domain shard.

Sharding took off when browsers allowed only a small number of connections per host. By splitting assets over a few hostnames, the page loaded more files at once. 

With HTTP/2 and HTTP/3, one connection can handle many files in parallel, so the old trick is less useful. The right answer depends on what your visitors actually use and how your CDN behaves.

‍{{cool-component}}‍

How Domain Sharding Works

Think of your site as a shop. Your HTML is the door. Images, CSS, and JavaScript are the items on the shelves. The browser can only carry a few items per trip from each storeroom. 

Domain sharding opens extra storerooms with their own doors, so the browser can fetch more items at once. Here is the basic flow.

  1. The page loads from www.example.com.
  2. Images load from static1.example.com.
  3. Scripts or other files load from static2.example.com.
  4. The browser keeps separate connections for each hostname. More hostnames can mean more parallel fetching.

A simple domain sharding example:

  • Page HTML: www.example.com/page
  • Images: static1.example.com/img/*
  • CSS and JS: static2.example.com/assets/*

That split is a domain shard in action. It is easy to set up. The value depends on your visitors and their browsers.

Why this ever helped:

  • Old rule with HTTP/1.1: only a few files per hostname at a time. Many files waited in line.
  • Domain sharding created extra hostnames. The browser opened more lines and cleared the queue faster.

Types Of Domain Sharding

There is more than one way to split things. Pick a pattern that matches your files and keeps caching simple.

Shard Type What It Means Use It When Watch Out For
By File Type Images on one host, CSS and JS on another Image-heavy pages. Easy mental model Two caches to manage. Duplicate headers if not careful
By Section Product images on one host, blog assets on another Different TTLs and cache rules per section Cross-section pages may hit both hosts
Hash Split (static1, static2) Evenly spread files across 2 hosts Legacy HTTP/1.1 clients with many small files Cache split across hosts. Harder debugging
By Upload Source User uploads vs site assets on separate hosts Clean security and CORS rules Extra DNS and TLS overhead
Multi-CDN Split Different hostnames point to different CDNs Reliability or regional routing Hard to keep headers and behavior identical

Prefer clear roles. For example, “images live on img.example-assets.com” and “everything else lives on static.example-assets.com.” 

This keeps logs, cache keys, and rules easy to reason about.

How Many Shards Are Enough

Start small. Measure. Stop early. A simple rule works for most stacks.

Protocol Mix In Your Traffic Recommended Shards Notes
Mostly HTTP/2 or HTTP/3 1 hostname Keep a single, warm, multiplexed connection
Mixed, with a real HTTP/1.1 slice 2 hostnames Small gain for older clients without heavy overhead
Mostly HTTP/1.1 on slow networks 2 to 3 hostnames Diminishing returns after 3. Measure both LCP and errors

CDN Domain Sharding And Edge Behavior

A CDN sits between your users and your files. It caches files at locations near the user and serves them fast. CDN domain sharding means using more than one CDN hostname, such as img1.example-cdn.com and img2.example-cdn.com.

What actually happens behind the scenes:

  • The CDN keeps a cache per hostname. Two hostnames often mean two caches.
  • With HTTP/2 and HTTP/3, the CDN can stream many files over one warm connection. Extra hostnames can add cost without adding speed.
  • Some CDNs can reuse one connection across hostnames if the certificate and settings match. When this works, multiple hosts behave almost like one. You still split the cache keys, so the benefit is limited.

When CDN domain sharding can help:

  • Failover or multi‑CDN. One hostname points to Provider A, another to Provider B. If one has a rough day, traffic can move to the other.
  • Rate limits per hostname. Low‑tier plans sometimes throttle per host. A second host may dodge a hard limit, but the real fix is a better plan.
  • Cookie isolation. Hosting assets on a cookie‑less hostname cuts overhead and can raise cache hits. This is about tidy headers more than parallelism.
  • Legacy clients. If you must support older browsers at scale, two CDN hosts can reduce long queues.

Best practice table:

Do This Not That Why
Use one CDN hostname for most assets Spread everything across four hosts on day one Extra DNS, TLS, and split caches hurt more than they help
Put large images or media on a second host only if testing proves gains Move critical CSS and JS to a second host without testing First paint slows down if CSS and JS pay an extra handshake
Keep certificates and TLS settings identical across hosts Mix protocols or ciphers per host Inconsistent behavior is hard to debug
Add preconnect hints for any extra host Skip connection warmup Cold starts can hide any parallel gains
Keep headers, CORS, and cache rules aligned Let each host drift Drift creates odd bugs and lower cache hits

‍{{cool-component}}‍

Conclusion

Speed comes from fewer slow starts, not from more moving parts. Treat domain sharding like a budget. Spend one extra hostname only if it pays for itself in a faster first paint. For modern traffic on HTTP/2 and HTTP/3, a single, well tuned asset host wins most days. 

If the data says an image‑only shard helps older devices, add one, measure it, and keep it honest. Clean up shards that do not prove their worth. The quiet site, with the fewest origins, usually feels the fastest.

FAQs

What Is A Domain Shard?

It is one of several asset hostnames your site uses. Instead of serving every file from www.example.com, you split files across static1.example.com and static2.example.com. Each extra hostname is a domain shard.

Can You Give A Quick Domain Sharding Example?

Yes. HTML from www.example.com, images from img.example-assets.com, and CSS plus JS from static.example-assets.com. That is a clean, easy domain sharding example without heavy code changes.

Does Domain Sharding Help On Mobile?

Only sometimes. On modern mobile browsers that support HTTP/2 or HTTP/3, one hostname is usually faster because it avoids extra DNS and security handshakes. On older devices or slow networks, two hosts for images can help a busy page.

Is Domain Sharding Bad For SEO?

Search engines do not punish the pattern by itself. SEO gains come from speed and stability. Keep HTTPS, caching, and consistent headers across hosts. Make sure all assets load without errors.

Published on:
October 15, 2025
IBC -  Mid banner

Related Glossary

See All Terms
IBC - Side Banner
This is some text inside of a div block.