React App fails to load after deploying via wrangler-action

Hi all,

Context: we have a Create-React-App that is deployed from Github Action to Cloudflare Worker via [email protected] Compiled assets (JS/CSS/images) in the /static/ folder from CRA build has cacheControl: { browserTTL: 8640000 } and files outside of the /static/ folder has a no-cache header.

Problem: right after a deploy, there is a chance that the app would not load for users that have visited our app before. The browser error shows that one of the React bundles fails to load. This problem happens rarely (~5%) but has been reoccurring for many months.

Since this problem does not consistently occur, it has been very frustrating to debug. My current guess is that the Cloudflare KV store associated with our app occasionally gets “full” and needs to expand / delete old entries. The supporting evidence is that the Cloudflare KV is full of old assets (old React bundles / manifests /etc), and we never need old versions of the app / old assets

If this was true, should I be bulk deleting / purging the KV on every deploy? Or is there another direction I can explore to debug this? Please let me know your thoughts.