CDN and Caching for Ecommerce in Thailand: What Actually Speeds Up a Local Storefront
A CDN badge on a hosting plan doesn't automatically mean a fast site for Thai shoppers. Edge coverage, cache invalidation, and what should and shouldn't be cached on a store where prices and stock change constantly.
BangkokSync6 min read
"We have a CDN" gets treated as a solved problem, when in practice a CDN is a tool that can genuinely transform how fast a store feels to a Thai shopper — or do almost nothing, depending entirely on how it's configured. The badge on a hosting plan doesn't tell you whether the CDN actually has a point of presence near Thailand, whether the right things are being cached, or whether a cached page is quietly showing yesterday's stock count to a shopper about to check out.
What a CDN actually does, and doesn't, fix
A CDN's real job is reducing the physical distance data has to travel: a static asset — an image, a CSS file, a JS bundle — gets served from an edge server geographically close to the shopper instead of round-tripping to wherever the origin server actually lives. For a Thai shopper, that distance matters enormously if the origin server is hosted somewhere far from Southeast Asia. A CDN with genuine edge presence in or near Thailand turns a slow, distant round trip into a fast, local one. A CDN without real regional coverage — routing a "nearby" request through a PoP in a different region — helps far less than the marketing page suggests, and this is worth actually checking rather than assuming.
Not everything on a product page should be cached the same way
The core tension on an ecommerce site is that some content is genuinely static (a product photo, a CSS file, most of a category page's layout) and some changes constantly (stock count, price, "only 2 left" messaging, a logged-in cart). Caching everything aggressively breaks the second category; caching nothing defeats the purpose of having a CDN at all. The practical split:
- Static assets — images, fonts, JS/CSS bundles — should be cached aggressively, often for a year, using filename-based cache-busting (a new build hash in the filename) rather than short cache lifetimes, so updates are instant and correctness never depends on a cache expiring.
- Product page HTML can usually be cached for a shorter window (minutes, not months) if price and stock are pulled in separately, or should be cached with an explicit invalidation trigger tied to actual product updates if the platform bakes price/stock directly into the page.
- Cart, checkout, and account pages should never be cached — these are inherently personal and dynamic, and caching them by accident is a correctness bug, not a performance win, sometimes literally showing one shopper's cart contents to another.
Stale stock and pricing is the failure mode that actually costs orders
The most damaging CDN misconfiguration on an ecommerce site isn't a slow page — it's a cached page showing outdated stock or price. A shopper who adds an "in stock" item to their cart, only to be told at checkout it's actually sold out, or who sees a price that turns out to have already changed, doesn't blame the CDN — they blame the store, and the trust cost compounds. This is exactly why a naive "cache everything for speed" approach is actively dangerous on a store with any real inventory turnover: the fix isn't avoiding caching, it's caching the right layer — static shell cached long, live price/stock data fetched fresh or invalidated the moment it changes, not bundled into the same long-lived cache as the product photo next to it.
Cache invalidation has to be tied to actual events, not just time
A time-based cache (max-age=3600, refresh every hour) is simple but
mismatched to how a store actually changes — a flash sale price change or
a stock-out needs to propagate immediately, not whenever the next hourly
refresh happens to land. The more reliable pattern is event-based
invalidation: the moment a price or stock level changes in the platform,
a purge request tells the CDN to drop that specific cached page instead of
waiting for it to expire naturally. This is more setup work upfront, but
it's the difference between a CDN that's fast and a CDN that's fast and
occasionally wrong.
Image delivery is usually the highest-leverage CDN use on a storefront
Product photography is typically the single heaviest asset category on an ecommerce page, and it's also the easiest to get real, measurable wins from: serving images through an image-optimizing CDN that automatically generates modern formats (WebP, AVIF) and resizes to the actual display size for each device — rather than shipping one oversized master image to every screen — cuts page weight substantially with zero visual difference to the shopper. This matters more in Thailand specifically than in markets with more consistently fast connections, because a chunk of mobile traffic is still on 4G rather than fixed broadband, and image weight is the first thing a slow connection punishes.
A cached 404 or 500 can quietly poison a URL for a long time
A subtler failure mode: if a CDN caches an error response — a 404 for a page that was requested a moment too early, before it actually existed on the origin, or a 500 during a brief deploy hiccup — with a long cache lifetime, that broken response can keep being served long after the underlying issue is fixed, because nothing tells the CDN to reconsider it. This is a genuinely easy trap to fall into during a deploy: checking a brand-new URL the instant it goes live, before the origin has actually finished updating, can accidentally cache the broken intermediate state for far longer than the actual outage lasted. The safer habit is confirming a fresh deploy has actually landed before the very first request to a new or changed URL, and configuring shorter cache lifetimes specifically for error responses so a transient blip can't get stuck.
What to actually check
- Confirm real edge coverage near Thailand — not just a global CDN claim, but an actual point of presence serving Southeast Asian traffic from nearby, checked directly rather than assumed from a features page.
- Separate the static shell from live price/stock data so the two can be cached on genuinely different timelines instead of one blunt setting for the whole page.
- Wire cache invalidation to real events — a price or stock change — rather than relying purely on time-based expiry for anything that actually needs to be current.
- Route product images through an image-optimizing CDN that serves modern formats at the right size per device, since this is usually the single biggest page-weight win available.
- Use short cache lifetimes for error responses specifically, and avoid being the first request to a brand-new URL immediately after a deploy, so a transient failure can't get cached and outlive the actual problem.
A CDN is genuinely one of the highest-leverage performance tools available to an ecommerce store — but only when it's actually configured around how the store's content behaves, rather than turned on once and trusted to handle everything on its own.



