Does Cloud CDN Serve Stale Content While Revalidating a 5xx Origin Response?
0 reputation · 26 Dec 2020, 02:39 UTC
I am designing a Cloud CDN caching policy behind an external HTTP(S) load balancer and need to confirm what clients receive when origin revalidation returns a 5xx error during a stale-while-revalidate window. The origin sends Cache-Control: stale-while-revalidate=60, and a previous 200 response may or may not already be cached.
I need to determine whether Cloud CDN serves the stale 200 body while refreshing in the background, or propagates the 5xx directly to the client. I also need to know how the result changes when no stale object exists, and whether behavior differs by region or load balancer type, assuming no forceCacheFill or bypassCacheOnHead overrides.
What does Cloud CDN return to the client when a stale object exists and origin revalidation returns 5xx? Does Cloud CDN return the 5xx directly on a cache miss with no stale copy? Are these behaviors consistent across regions and between external and internal HTTP(S) load balancers?