[{"data":1,"prerenderedAt":805},["ShallowReactive",2],{"content:\u002Fadvanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002Fsoft-purge-vs-hard-purge":3,"surroundings:\u002Fadvanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002Fsoft-purge-vs-hard-purge":797},{"id":4,"title":5,"body":6,"description":776,"extension":777,"meta":778,"navigation":790,"path":791,"seo":792,"stem":795,"__hash__":796},"content\u002Fadvanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002Fsoft-purge-vs-hard-purge\u002Findex.md","Soft Purge vs Hard Purge",{"type":7,"value":8,"toc":758},"minimark",[9,14,47,50,163,168,196,200,206,212,218,227,277,281,286,289,293,302,325,328,332,412,416,419,558,562,565,569,576,580,583,587,590,594,620,624,634,640,646,652,656,668,677,686,698,707,716,720,743,748,751,754],[10,11,13],"h1",{"id":12},"soft-purge-vs-hard-purge-choosing-how-to-invalidate-cdn-content","Soft Purge vs Hard Purge: Choosing How to Invalidate CDN Content",[15,16,17,18,23,24,28,29,33,34,37,38,42,43,46],"p",{},"This comparison sits within ",[19,20,22],"a",{"href":21},"\u002Fadvanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002F","Cache Invalidation Patterns",", part of ",[19,25,27],{"href":26},"\u002Fadvanced-caching-strategies-cdn-architecture\u002F","Advanced Caching Strategies & CDN Architecture",". When content changes, the CDN must stop serving the old version. A ",[30,31,32],"strong",{},"hard purge"," deletes the object from cache: the next request is a full miss that waits for the origin. A ",[30,35,36],{},"soft purge"," (Fastly's term; other CDNs have equivalents such as \"invalidate as stale\" or revalidation-forcing purges) marks the object stale instead: if ",[39,40,41],"code",{},"stale-while-revalidate"," or ",[39,44,45],{},"stale-if-error"," allow, the CDN can still serve it while fetching a fresh copy in the background.",[15,48,49],{},"The difference matters most at scale. Purging a tag that covers thousands of pages — a site-wide header change, a price update across a category — with a hard purge sends every subsequent request for those pages to the origin until each is refilled. If the origin is slow or struggling, that purge can trigger an outage. A soft purge spreads the refresh over background requests, keeps TTFB at cache speed, and leaves stale content available if the origin fails.",[15,51,52],{},[53,54,60,61,60,68,60,72,60,75,60,84,60,90,60,99,60,105,60,110,60,115,60,118,60,121,60,124,60,127,60,130,60,133,60,138,60,142,60,144,60,148,60,150,60,153,60,155,60,158,60,160,60],"svg",{"viewBox":55,"width":56,"role":57,"ariaLabel":58,"style":59},"0 0 760 228","100%","img","Comparison of what happens after a hard purge and after a soft purge of a large set of cached pages.","height:auto;max-width:760px;display:block;margin:1.75rem auto;font-family:inherit;color:var(--fp-svg-ink)"," ",[62,63],"rect",{"className":64,"x":66,"y":66,"width":56,"height":56,"fill":67},[65],"svg-canvas","0","#ffffff",[69,70,71],"title",{},"Hard purge vs soft purge",[73,74,58],"desc",{},[62,76],{"x":77,"y":77,"width":78,"height":79,"rx":80,"fill":81,"stroke":82,"style":83},"1","758","226","10","none","currentColor","stroke-opacity:0.18",[85,86,71],"text",{"x":87,"y":88,"fill":82,"style":89},"28.0","34.0","font-size:16px;font-weight:700",[62,91],{"x":87,"y":92,"width":93,"height":94,"rx":95,"fill":96,"stroke":97,"style":98},"56.0","340.0","150.0","6","#ffc300","#b8860b","fill-opacity:0.24;stroke-opacity:0.9",[85,100,104],{"x":101,"y":102,"fill":82,"style":103},"42.0","82.0","font-size:14px;font-weight:700","Hard purge",[85,106,109],{"x":101,"y":107,"fill":82,"style":108},"108.0","font-size:12.5px;font-weight:700","•",[85,111,114],{"x":92,"y":107,"fill":82,"style":112,"textAnchor":113},"font-size:12.5px","start","Objects deleted immediately",[85,116,109],{"x":101,"y":117,"fill":82,"style":108},"132.0",[85,119,120],{"x":92,"y":117,"fill":82,"style":112,"textAnchor":113},"Next requests block on origin",[85,122,109],{"x":101,"y":123,"fill":82,"style":108},"156.0",[85,125,126],{"x":92,"y":123,"fill":82,"style":112,"textAnchor":113},"Origin load spikes after large purges",[85,128,109],{"x":101,"y":129,"fill":82,"style":108},"180.0",[85,131,132],{"x":92,"y":129,"fill":82,"style":112,"textAnchor":113},"Nothing to serve if origin fails",[62,134],{"x":135,"y":92,"width":93,"height":94,"rx":95,"fill":136,"stroke":136,"style":137},"392.0","#0466c8","fill-opacity:0.14;stroke-opacity:0.9",[85,139,141],{"x":140,"y":102,"fill":82,"style":103},"406.0","Soft purge",[85,143,109],{"x":140,"y":107,"fill":82,"style":108},[85,145,147],{"x":146,"y":107,"fill":82,"style":112,"textAnchor":113},"420.0","Objects marked stale",[85,149,109],{"x":140,"y":117,"fill":82,"style":108},[85,151,152],{"x":146,"y":117,"fill":82,"style":112,"textAnchor":113},"Served stale while refreshing (within SWR)",[85,154,109],{"x":140,"y":123,"fill":82,"style":108},[85,156,157],{"x":146,"y":123,"fill":82,"style":112,"textAnchor":113},"Refresh spread over background requests",[85,159,109],{"x":140,"y":129,"fill":82,"style":108},[85,161,162],{"x":146,"y":129,"fill":82,"style":112,"textAnchor":113},"stale-if-error still available",[164,165,167],"h2",{"id":166},"rapid-diagnosis","Rapid Diagnosis",[169,170,171,178,184,190],"ul",{},[172,173,174,177],"li",{},[30,175,176],{},"Check post-purge origin traffic."," Graph origin requests around large purges; tall spikes indicate hard purges of popular content.",[172,179,180,183],{},[30,181,182],{},"Check TTFB after deploys."," If TTFB p75 jumps for minutes after each deploy's purge, users are paying for refills.",[172,185,186,189],{},[30,187,188],{},"Check freshness requirements."," Some content must never be served stale after a change (legal takedowns, price errors); other content can tolerate seconds of staleness.",[172,191,192,195],{},[30,193,194],{},"Check CDN capabilities."," Not all CDNs offer soft purge; some emulate it via short revalidation.",[164,197,199],{"id":198},"root-cause-analysis","Root Cause Analysis",[15,201,202,205],{},[30,203,204],{},"1. Hard purges of broad tags."," A tag shared by many pages (a header fragment, a category) deletes large swaths of cache at once.",[15,207,208,211],{},[30,209,210],{},"2. Cold refill."," Every deleted object needs a blocking origin fetch, concentrating load right after the purge.",[15,213,214,217],{},[30,215,216],{},"3. Coupled with deploys."," Purges on deploy coincide with new code warming up, making the origin slowest exactly when load is highest.",[15,219,220,223,224,226],{},[30,221,222],{},"4. No stale safety net."," Hard-purged objects cannot be served even under ",[39,225,45],{},".",[15,228,229],{},[53,230,60,233,60,236,60,239,60,241,60,244,60,246,60,252,60,259,60,264,60,268,60,273,60],{"viewBox":231,"width":56,"role":57,"ariaLabel":232,"style":59},"0 0 760 132","Bar chart of origin requests after purging twenty thousand pages with a hard purge versus a soft purge with stale-while-revalidate.",[62,234],{"className":235,"x":66,"y":66,"width":56,"height":56,"fill":67},[65],[69,237,238],{},"Origin requests in the 5 minutes after purging 20k pages",[73,240,232],{},[62,242],{"x":77,"y":77,"width":78,"height":243,"rx":80,"fill":81,"stroke":82,"style":83},"130",[85,245,238],{"x":87,"y":88,"fill":82,"style":89},[85,247,104],{"x":248,"y":249,"fill":82,"style":250,"textAnchor":251},"132.8","70.0","font-size:13px","end",[62,253],{"x":254,"y":92,"width":255,"height":256,"rx":257,"fill":96,"stroke":97,"style":258},"144.8","523.2","19","3","fill-opacity:0.7;stroke-opacity:0.9",[85,260,263],{"x":261,"y":249,"fill":82,"style":262},"674.0","font-size:12px;font-weight:600","46k",[85,265,267],{"x":248,"y":266,"fill":82,"style":250,"textAnchor":251},"101.0","Soft purge + SWR",[62,269],{"x":254,"y":270,"width":271,"height":256,"rx":257,"fill":136,"stroke":136,"style":272},"87.0","102.4","fill-opacity:0.55;stroke-opacity:0.9",[85,274,276],{"x":275,"y":266,"fill":82,"style":262},"253.1","9k",[164,278,280],{"id":279},"step-by-step-resolution","Step-by-Step Resolution",[282,283,285],"h3",{"id":284},"_1-classify-content-by-staleness-tolerance","1. Classify content by staleness tolerance",[15,287,288],{},"Content that must disappear immediately (legal removals, security issues, wrong prices with legal implications): hard purge. Everything else — editorial updates, design changes, routine data refreshes: soft purge.",[282,290,292],{"id":291},"_2-make-sure-responses-allow-stale-serving","2. Make sure responses allow stale serving",[15,294,295,296,298,299,301],{},"Soft purges only help if cached responses carry ",[39,297,41],{}," (and ideally ",[39,300,45],{},") or the CDN-specific equivalent; otherwise a stale object is treated like an expired one and fetched synchronously.",[303,304,309],"pre",{"className":305,"code":306,"language":307,"meta":308,"style":308},"language-http shiki shiki-themes github-light-high-contrast github-dark-high-contrast github-light-high-contrast","Cache-Control: public, max-age=0, s-maxage=3600, stale-while-revalidate=600, stale-if-error=86400\nSurrogate-Key: article-123 section-sport\n","http","",[39,310,311,319],{"__ignoreMap":308},[312,313,316],"span",{"class":314,"line":315},"line",1,[312,317,318],{},"Cache-Control: public, max-age=0, s-maxage=3600, stale-while-revalidate=600, stale-if-error=86400\n",[312,320,322],{"class":314,"line":321},2,[312,323,324],{},"Surrogate-Key: article-123 section-sport\n",[15,326,327],{},"(The trade-off: after a soft purge, some users can see the previous version for a few seconds while the background refresh completes.)",[282,329,331],{"id":330},"_3-use-soft-purge-in-publish-and-deploy-pipelines","3. Use soft purge in publish and deploy pipelines",[303,333,337],{"className":334,"code":335,"language":336,"meta":308,"style":308},"language-bash shiki shiki-themes github-light-high-contrast github-dark-high-contrast github-light-high-contrast","# Fastly: soft purge by surrogate key.\ncurl -sX POST \"https:\u002F\u002Fapi.fastly.com\u002Fservice\u002F$SERVICE\u002Fpurge\u002Fsection-sport\" \\\n  -H \"Fastly-Key: $FASTLY_TOKEN\" -H \"Fastly-Soft-Purge: 1\"\n# trade-off: soft purge semantics differ between CDNs; on platforms without a\n# native soft purge, a hard purge plus request collapsing and tiered caching is\n# the closest alternative.\n","bash",[39,338,339,345,373,394,400,406],{"__ignoreMap":308},[312,340,341],{"class":314,"line":315},[312,342,344],{"class":343},"sjfSM","# Fastly: soft purge by surrogate key.\n",[312,346,347,351,355,359,362,366,369],{"class":314,"line":321},[312,348,350],{"class":349},"sQw3B","curl",[312,352,354],{"class":353},"sPXB4"," -sX",[312,356,358],{"class":357},"sZ8jY"," POST",[312,360,361],{"class":357}," \"https:\u002F\u002Fapi.fastly.com\u002Fservice\u002F",[312,363,365],{"class":364},"saISM","$SERVICE",[312,367,368],{"class":357},"\u002Fpurge\u002Fsection-sport\"",[312,370,372],{"class":371},"sPARh"," \\\n",[312,374,376,379,382,385,388,391],{"class":314,"line":375},3,[312,377,378],{"class":353},"  -H",[312,380,381],{"class":357}," \"Fastly-Key: ",[312,383,384],{"class":364},"$FASTLY_TOKEN",[312,386,387],{"class":357},"\"",[312,389,390],{"class":353}," -H",[312,392,393],{"class":357}," \"Fastly-Soft-Purge: 1\"\n",[312,395,397],{"class":314,"line":396},4,[312,398,399],{"class":343},"# trade-off: soft purge semantics differ between CDNs; on platforms without a\n",[312,401,403],{"class":314,"line":402},5,[312,404,405],{"class":343},"# native soft purge, a hard purge plus request collapsing and tiered caching is\n",[312,407,409],{"class":314,"line":408},6,[312,410,411],{"class":343},"# the closest alternative.\n",[282,413,415],{"id":414},"_4-reserve-hard-purge-for-emergencies","4. Reserve hard purge for emergencies",[15,417,418],{},"Keep a separate, clearly labelled hard-purge path for content that must vanish immediately, and use it deliberately.",[15,420,421],{},[53,422,60,425,60,428,60,431,60,433,60,450,60,453,60,455,60,460,60,467,60,471,60,474,60,478,60,485,60,491,60,494,60,500,60,504,60,508,60,510,60,513,60,516,60,519,60,523,60,526,60,529,60,533,60,535,60,538,60,541,60,544,60,548,60,551,60,554,60],{"viewBox":423,"width":56,"role":57,"ariaLabel":424,"style":59},"0 0 760 342","Decision sequence for choosing between soft and hard purges after a content change.",[62,426],{"className":427,"x":66,"y":66,"width":56,"height":56,"fill":67},[65],[69,429,430],{},"Which purge for this change?",[73,432,424],{},[434,435,436],"defs",{},[437,438,445],"marker",{"id":439,"viewBox":440,"refX":441,"refY":442,"markerWidth":443,"markerHeight":443,"orient":444},"fa4baf0d2d","0 0 10 10","9","5","7","auto-start-reverse",[446,447],"path",{"d":448,"fill":82,"style":449},"M0 0 L10 5 L0 10 z","fill-opacity:0.7",[62,451],{"x":77,"y":77,"width":78,"height":452,"rx":80,"fill":81,"stroke":82,"style":83},"340",[85,454,430],{"x":87,"y":88,"fill":82,"style":89},[62,456],{"x":87,"y":92,"width":457,"height":458,"rx":95,"fill":82,"stroke":82,"style":459},"320.0","52.0","fill-opacity:0.06;stroke-opacity:0.4",[85,461,466],{"x":462,"y":463,"fill":82,"style":464,"textAnchor":465},"188.0","78.0","font-size:13px;font-weight:700","middle","Must the old version never be shown again (legal,",[85,468,470],{"x":462,"y":469,"fill":82,"style":464,"textAnchor":465},"95.0","security)?",[62,472],{"x":473,"y":92,"width":457,"height":458,"rx":95,"fill":96,"stroke":97,"style":98},"412.0",[85,475,104],{"x":476,"y":477,"fill":82,"style":112,"textAnchor":465},"572.0","86.5",[314,479],{"x1":480,"y1":102,"x2":481,"y2":102,"stroke":82,"strokeWidth":482,"style":483,"markerEnd":484},"348.0","410.0","1.5","stroke-opacity:0.6","url(#fa4baf0d2d)",[85,486,490],{"x":487,"y":488,"fill":136,"style":489,"textAnchor":465},"380.0","75.0","font-size:11.5px;font-weight:700","yes",[314,492],{"x1":462,"y1":107,"x2":462,"y2":493,"stroke":82,"strokeWidth":482,"style":483,"markerEnd":484},"142.0",[85,495,499],{"x":496,"y":497,"fill":498,"style":489},"196.0","130.0","#51617a","no",[62,501],{"x":87,"y":502,"width":457,"height":503,"rx":95,"fill":82,"stroke":82,"style":459},"144.0","35.0",[85,505,507],{"x":462,"y":506,"fill":82,"style":464,"textAnchor":465},"166.0","Does the change affect many pages at once?",[62,509],{"x":473,"y":502,"width":457,"height":503,"rx":95,"fill":136,"stroke":136,"style":137},[85,511,512],{"x":476,"y":506,"fill":82,"style":112,"textAnchor":465},"Soft purge — avoid an origin spike",[314,514],{"x1":480,"y1":515,"x2":481,"y2":515,"stroke":82,"strokeWidth":482,"style":483,"markerEnd":484},"161.5",[85,517,490],{"x":487,"y":518,"fill":136,"style":489,"textAnchor":465},"154.5",[314,520],{"x1":462,"y1":521,"x2":462,"y2":522,"stroke":82,"strokeWidth":482,"style":483,"markerEnd":484},"179.0","213.0",[85,524,499],{"x":496,"y":525,"fill":498,"style":489},"201.0",[62,527],{"x":87,"y":528,"width":457,"height":503,"rx":95,"fill":82,"stroke":82,"style":459},"215.0",[85,530,532],{"x":462,"y":531,"fill":82,"style":464,"textAnchor":465},"237.0","Is the origin under load or slow?",[62,534],{"x":473,"y":528,"width":457,"height":503,"rx":95,"fill":136,"stroke":136,"style":137},[85,536,537],{"x":476,"y":531,"fill":82,"style":112,"textAnchor":465},"Soft purge with stale-if-error",[314,539],{"x1":480,"y1":540,"x2":481,"y2":540,"stroke":82,"strokeWidth":482,"style":483,"markerEnd":484},"232.5",[85,542,490],{"x":487,"y":543,"fill":136,"style":489,"textAnchor":465},"225.5",[314,545],{"x1":462,"y1":546,"x2":462,"y2":547,"stroke":82,"strokeWidth":482,"style":483,"markerEnd":484},"250.0","284.0",[85,549,499],{"x":496,"y":550,"fill":498,"style":489},"272.0",[62,552],{"x":87,"y":553,"width":457,"height":88,"rx":95,"fill":96,"stroke":97,"style":98},"286.0",[85,555,557],{"x":462,"y":556,"fill":82,"style":112,"textAnchor":465},"307.5","Soft purge (default)",[164,559,561],{"id":560},"verification","Verification",[15,563,564],{},"After switching publish pipelines to soft purges, compare origin request rates and TTFB p75 in the minutes after purges with the previous behaviour. Spot-check that updated content appears within seconds (the background refresh) and that hard purges still remove content immediately when used.",[164,566,568],{"id":567},"worked-example-site-wide-navigation-changes","Worked Example: Site-Wide Navigation Changes",[15,570,571,572,575],{},"A publisher tagged every page with ",[39,573,574],{},"nav"," because the navigation was rendered into each page. Changing a menu item hard-purged 180,000 pages; origin traffic spiked twentyfold and TTFB p75 rose above two seconds for several minutes. Switching to soft purges with a 10-minute SWR window kept TTFB at cache-hit levels throughout, and origin traffic rose only modestly as pages refreshed in the background. The team later moved the navigation to a separately cached fragment, which removed the need for site-wide purges altogether.",[164,577,579],{"id":578},"reducing-the-need-for-broad-purges","Reducing the Need for Broad Purges",[15,581,582],{},"The best purge is a narrow one. Content that appears on many pages — navigation, footers, promotional banners, related-article widgets — causes broad purges whenever it changes. Moving such shared elements into separately cached fragments (assembled at the edge or fetched on the client) means a navigation change purges one fragment instead of every page. Similarly, tagging pages precisely (only with the entities they actually display) keeps purges proportional to what changed. Soft purging softens the impact of broad purges; fragment architecture and precise tags make them rare.",[164,584,586],{"id":585},"purge-hygiene-in-pipelines","Purge Hygiene in Pipelines",[15,588,589],{},"Treat purges as part of the release, with the same observability as the deploy itself. Log each purge with its tags, the triggering event (deploy, publish, manual) and its type (soft or hard). Rate-limit automated hard purges so a misconfigured job cannot clear the whole cache repeatedly. And run a post-purge check: fetch a sample of affected URLs after a short delay and confirm the new content is served — catching the silent failures (wrong tag, expired API token) that otherwise leave stale content live until someone notices.",[164,591,593],{"id":592},"common-mistakes","Common Mistakes",[169,595,596,602,608,614],{},[172,597,598,601],{},[30,599,600],{},"Soft purging responses without SWR."," The stale object cannot be served, so behaviour is identical to a hard purge.",[172,603,604,607],{},[30,605,606],{},"Hard purging on every deploy."," Deploys rarely require instant removal of all HTML; soft purge suffices.",[172,609,610,613],{},[30,611,612],{},"Overly broad tags."," One tag on everything turns every change into a site-wide purge.",[172,615,616,619],{},[30,617,618],{},"Not monitoring post-purge load."," Purge-induced spikes are invisible without origin metrics around purge events.",[164,621,623],{"id":622},"edge-cases","Edge Cases",[15,625,626,629,630,633],{},[30,627,628],{},"CDNs without soft purge."," Emulate it with short ",[39,631,632],{},"s-maxage"," plus SWR and rely on natural expiry for most updates, keeping hard purges for urgent changes.",[15,635,636,639],{},[30,637,638],{},"Multi-layer caches."," A soft purge at the CDN does not affect browser caches or your own reverse proxy; align layers.",[15,641,642,645],{},[30,643,644],{},"Personalised content."," Purges apply to shared caches; personal data should not be in them.",[15,647,648,651],{},[30,649,650],{},"Purge rate limits."," CDNs limit purge API calls; batch tags and avoid per-object purges in tight loops.",[164,653,655],{"id":654},"faq","FAQ",[657,658,661,665],"details",{"className":659},[660],"faq-item",[662,663,664],"summary",{},"Does a soft purge guarantee users see new content immediately?",[15,666,667],{},"No. Users may receive the stale version until the background refresh completes — usually seconds. For content where even that is unacceptable, use a hard purge.",[657,669,671,674],{"className":670},[660],[662,672,673],{},"Is soft purge the same as setting a short TTL?",[15,675,676],{},"No. A short TTL expires everything constantly; a soft purge marks only the changed content stale, at the moment it changes, while everything else keeps its long TTL.",[657,678,680,683],{"className":679},[660],[662,681,682],{},"Which CDNs support soft purge?",[15,684,685],{},"Fastly supports it natively; others offer similar behaviour under different names or through revalidation settings. Check your CDN's purge documentation for \"stale\" or \"invalidate\" modes.",[657,687,689,692],{"className":688},[660],[662,690,691],{},"Does soft purge help during origin outages?",[15,693,694,695,697],{},"Yes. Soft-purged objects remain available for ",[39,696,45],{},", so if the origin is down when refreshes are attempted, users still get content.",[657,699,701,704],{"className":700},[660],[662,702,703],{},"How should deploys purge HTML?",[15,705,706],{},"Soft purge HTML by tag on deploy, so new pages roll out within seconds without an origin spike. Hashed assets need no purge at all.",[657,708,710,713],{"className":709},[660],[662,711,712],{},"What about purging images after edits?",[15,714,715],{},"Edited images should get new URLs (hashes or versions) so no purge is needed. If URLs must stay stable, soft purge is usually fine.",[164,717,719],{"id":718},"related","Related",[169,721,722,729,736],{},[172,723,724,728],{},[19,725,727],{"href":726},"\u002Fadvanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002Fpurging-cdn-cache-by-tag-on-deploy\u002F","Purging CDN cache by tag on deploy"," — tagging and purge pipelines.",[172,730,731,735],{},[19,732,734],{"href":733},"\u002Fadvanced-caching-strategies-cdn-architecture\u002Fstale-while-revalidate-implementation\u002Fchoosing-swr-windows-for-html-and-apis\u002F","Choosing SWR windows for HTML and APIs"," — the windows soft purges rely on.",[172,737,738,742],{},[19,739,741],{"href":740},"\u002Fadvanced-caching-strategies-cdn-architecture\u002Fedge-compute-and-dynamic-caching\u002Fedge-side-includes-vs-client-side-fragments\u002F","Edge Side Includes vs client-side fragments"," — fragment architectures that narrow purges.",[744,745,747],"script",{"type":746},"application\u002Fld+json","\n{\n  \"@context\": \"https:\u002F\u002Fschema.org\",\n  \"@type\": \"HowTo\",\n  \"name\": \"Soft Purge vs Hard Purge: Choosing How to Invalidate CDN Content\",\n  \"description\": \"When to delete cached content outright and when to mark it stale, and how each affects origin load, TTFB and resilience after content changes.\",\n  \"step\": [\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 1,\n      \"name\": \"Classify content by staleness tolerance\",\n      \"text\": \"Content that must disappear immediately (legal removals, security issues, wrong prices with legal implications): hard purge.\"\n    },\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 2,\n      \"name\": \"Make sure responses allow stale serving\",\n      \"text\": \"Soft purges only help if cached responses carry stale-while-revalidate (and ideally stale-if-error) or the CDN-specific equivalent; otherwise a stale object is treated like an expired one and fetched synchronously.\"\n    },\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 3,\n      \"name\": \"Use soft purge in publish and deploy pipelines\",\n      \"text\": \"Use soft purge in publish and deploy pipelines\"\n    },\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 4,\n      \"name\": \"Reserve hard purge for emergencies\",\n      \"text\": \"Keep a separate, clearly labelled hard-purge path for content that must vanish immediately, and use it deliberately.\"\n    }\n  ]\n}\n",[744,749,750],{"type":746},"\n{\n  \"@context\": \"https:\u002F\u002Fschema.org\",\n  \"@type\": \"TechArticle\",\n  \"headline\": \"Soft Purge vs Hard Purge: Choosing How to Invalidate CDN Content\",\n  \"description\": \"When to delete cached content outright and when to mark it stale, and how each affects origin load, TTFB and resilience after content changes.\",\n  \"datePublished\": \"2026-10-06\",\n  \"dateModified\": \"2026-10-06\",\n  \"author\": {\n    \"@type\": \"Organization\",\n    \"name\": \"frontend-performance.com\"\n  },\n  \"publisher\": {\n    \"@type\": \"Organization\",\n    \"name\": \"frontend-performance.com\"\n  },\n  \"mainEntityOfPage\": {\n    \"@type\": \"WebPage\",\n    \"@id\": \"https:\u002F\u002Ffrontend-performance.com\u002Fadvanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002Fsoft-purge-vs-hard-purge\u002F\"\n  }\n}\n",[744,752,753],{"type":746},"\n{\n  \"@context\": \"https:\u002F\u002Fschema.org\",\n  \"@type\": \"BreadcrumbList\",\n  \"itemListElement\": [\n    {\n      \"@type\": \"ListItem\",\n      \"position\": 1,\n      \"name\": \"Home\",\n      \"item\": \"https:\u002F\u002Ffrontend-performance.com\u002F\"\n    },\n    {\n      \"@type\": \"ListItem\",\n      \"position\": 2,\n      \"name\": \"Advanced Caching Strategies & CDN Architecture\",\n      \"item\": \"https:\u002F\u002Ffrontend-performance.com\u002Fadvanced-caching-strategies-cdn-architecture\u002F\"\n    },\n    {\n      \"@type\": \"ListItem\",\n      \"position\": 3,\n      \"name\": \"Cache Invalidation Patterns\",\n      \"item\": \"https:\u002F\u002Ffrontend-performance.com\u002Fadvanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002F\"\n    },\n    {\n      \"@type\": \"ListItem\",\n      \"position\": 4,\n      \"name\": \"Soft Purge vs Hard Purge\",\n      \"item\": \"https:\u002F\u002Ffrontend-performance.com\u002Fadvanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002Fsoft-purge-vs-hard-purge\u002F\"\n    }\n  ]\n}\n",[755,756,757],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html pre.shiki code .sjfSM, html code.shiki .sjfSM{--shiki-default:#66707B;--shiki-dark:#BDC4CC;--shiki-light:#66707B}html pre.shiki code .sQw3B, html code.shiki .sQw3B{--shiki-default:#702C00;--shiki-dark:#FFB757;--shiki-light:#702C00}html pre.shiki code .sPXB4, html code.shiki .sPXB4{--shiki-default:#023B95;--shiki-dark:#91CBFF;--shiki-light:#023B95}html pre.shiki code .sZ8jY, html code.shiki .sZ8jY{--shiki-default:#032563;--shiki-dark:#ADDCFF;--shiki-light:#032563}html pre.shiki code .saISM, html code.shiki .saISM{--shiki-default:#0E1116;--shiki-dark:#F0F3F6;--shiki-light:#0E1116}html pre.shiki code .sPARh, html code.shiki .sPARh{--shiki-default:#A0111F;--shiki-dark:#FF9492;--shiki-light:#A0111F}",{"title":308,"searchDepth":321,"depth":321,"links":759},[760,761,762,768,769,770,771,772,773,774,775],{"id":166,"depth":321,"text":167},{"id":198,"depth":321,"text":199},{"id":279,"depth":321,"text":280,"children":763},[764,765,766,767],{"id":284,"depth":375,"text":285},{"id":291,"depth":375,"text":292},{"id":330,"depth":375,"text":331},{"id":414,"depth":375,"text":415},{"id":560,"depth":321,"text":561},{"id":567,"depth":321,"text":568},{"id":578,"depth":321,"text":579},{"id":585,"depth":321,"text":586},{"id":592,"depth":321,"text":593},{"id":622,"depth":321,"text":623},{"id":654,"depth":321,"text":655},{"id":718,"depth":321,"text":719},"When to delete cached content outright and when to mark it stale, and how each affects origin load, TTFB and resilience after content changes.","md",{"slug":779,"type":780,"breadcrumb":781,"datePublished":789,"dateModified":789},"soft-purge-vs-hard-purge","article",[782,785,786,787],{"name":783,"url":784},"Home","\u002F",{"name":27,"url":26},{"name":22,"url":21},{"name":5,"url":788},"\u002Fadvanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002Fsoft-purge-vs-hard-purge\u002F","2026-10-06",true,"\u002Fadvanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002Fsoft-purge-vs-hard-purge",{"title":793,"description":794},"Soft Purge vs Hard Purge: Invalidating CDN Caches","A hard purge deletes cached objects; a soft purge marks them stale so they can still be served while refreshing. Compare origin load, freshness, resilience.","advanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002Fsoft-purge-vs-hard-purge\u002Findex","DHWlIcCdOv2WPpZizz-jMVHXqi_JRInJs8P7YOsnamY",[798,801],{"title":727,"path":799,"stem":800,"children":-1},"\u002Fadvanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002Fpurging-cdn-cache-by-tag-on-deploy","advanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002Fpurging-cdn-cache-by-tag-on-deploy\u002Findex",{"title":802,"path":803,"stem":804,"children":-1},"Versioning API Responses for Cache Busting","\u002Fadvanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002Fversioning-api-responses-for-cache-busting","advanced-caching-strategies-cdn-architecture\u002Fcache-invalidation-patterns\u002Fversioning-api-responses-for-cache-busting\u002Findex",1791308075342]