We are using the non-KV stale while revalidate path. A great functionality would be, when doing the update of the cached copy of the page, if the origin returns a 5xx response or timeout then don't purge the cache for that page and continue to serve the prior non-5xx page that was last cached to visitors. I think I need to update the function starting at line 249 in the edge cache example but I am kind of lost because I do more admin than programming and haven't used javascript much. Is this an easy change? Would it break other things?
We are using the non-KV stale while revalidate path. A great functionality would be, when doing the update of the cached copy of the page, if the origin returns a 5xx response or timeout then don't purge the cache for that page and continue to serve the prior non-5xx page that was last cached to visitors. I think I need to update the function starting at line 249 in the edge cache example but I am kind of lost because I do more admin than programming and haven't used javascript much. Is this an easy change? Would it break other things?