On this page
What this issue is
Modern build tools add a hash to each file name, such as app.3f9a1c.js. The hash changes whenever the code changes. This lets browsers cache files for a long time safely.
The problem starts when you deploy a new version. The new build creates app.7b2e90.js and often removes the old file. But some visitors, a CDN or a page cache still hold the old HTML, which asks for app.3f9a1c.js. That file is gone, so the server returns 404 Not Found.
- DeployNew build replaces old hashed files
- Cached HTML servedCDN or cache still holds the old page
- Old bundle requestedapp.3f9a1c.js returns 404
- Form and buttonsNo JavaScript, no handlers
- Tracking and leadTags and submissions never happen
The cached HTML points to a file the new release removed.
Why it costs you leads or sales
The page still loads, so nothing looks wrong at a glance. But if the missing file holds your form logic, checkout code, chat widget or tag setup, those parts stop working. Visitors click and nothing happens.
Ad traffic makes it worse. You keep paying for clicks that land on a page that cannot convert. Because analytics scripts may also fail, the lost conversions may not even show in your reports.
10:00
You deploy a new release. Old JS files are removed.
10:01
Your CDN keeps serving the HTML it cached earlier.
10:02
Visitors load the page; the old script URL returns 404.
Next day
Leads are down, but no one has seen an error.
Later
Cache is purged or expires and the page works again.
Example: illustrative numbers showing how a stale-cache 404 can quietly cut submissions until the cache clears.
How to check if your site has it
Open the page in a private window
Use the exact URL your ads or emails send people to.
Open DevTools and the Network tab
Press F12, open Network, tick Disable cache off, and reload. Filter by JS.
Look for red 404 rows
A failed
.jsfile with a hash in its name is the sign of this issue. The Console tab will also show 'Failed to load resource: 404'.Compare with the live HTML
Right-click, View page source, and note the script URLs. Then open one directly. If it returns 404, the HTML is stale.
Check the cache headers on the HTML
Run the command below and look at Cache-Control, Age and any CDN cache status header.
curl -sI https://example.com/landing/ | grep -iE 'cache-control|age|etag|x-cache|cf-cache-status'
curl -s -o /dev/null -w '%{http_code}\n' https://example.com/assets/app.3f9a1c.jsHow to fix it
The goal is simple: HTML and the files it references must stay in step. Either keep old files around for a while, or make sure HTML is refreshed right after each deploy.
Purge the HTML cache now
Clear your CDN, page cache and server cache so new HTML with new hashes is served.
Keep old assets after a deploy
Do not delete the previous release's hashed files straight away. Keep them for several days so cached pages still work.
Do not cache HTML for long
Use a short or revalidating Cache-Control on HTML, and a long immutable cache only on hashed assets.
Purge cache as part of the deploy
Add a cache purge step at the end of your deploy pipeline.
location / {
add_header Cache-Control "no-cache";
}
location /assets/ {
add_header Cache-Control "public, max-age=31536000, immutable";
}Purge all caches
Clear your caching plugin (WP Rocket, LiteSpeed Cache, W3 Total Cache and similar) and any host or CDN cache.
Regenerate combined files
If a plugin minifies or combines JS, clear its generated files so the HTML points to current ones.
Exclude key pages from page cache if needed
Landing pages, checkout and forms can be set to bypass cache in your caching plugin settings.
Check theme and app scripts
Shopify serves theme assets from its CDN with versioned URLs. A 404 usually comes from a custom script URL or an app that was updated or removed.
Fix hard-coded asset links
In the theme code, use the
asset_urlfilter instead of typing file URLs by hand.
Check Custom HTML tags
Look for tags that load a script from a URL with a build hash. Replace them with a stable URL or update to the current file.
Preview and publish
Use Preview mode, confirm there is no 404 in the Network tab, then publish the container.
Republish the site
Publish again so pages get fresh references to Webflow assets.
Check custom code
In Site settings, Custom code, look for script links to files you host elsewhere that may have been renamed or removed.
Check custom JS and external scripts
In your funnel or website tracking code and custom code blocks, look for links to files hosted outside GoHighLevel that no longer exist.
Republish the funnel page
Save and publish the page again, then test in a private window.
Keep the last few builds
Upload new assets without removing old ones until the cache window has passed.
Set cache headers by file type
HTML short or no-cache; hashed JS and CSS long and immutable.
Purge the CDN in your pipeline
Call your CDN's purge API after each deploy, then clean up old assets later.
Before
- Old JS files deleted on every deploy
- HTML cached for hours or days
- No cache purge after release
- Failures found by customers
After
- Previous build's files kept for several days
- HTML revalidated or cached briefly
- Cache purged at the end of each deploy
- Key pages checked after every release
How to confirm it's fixed
- Load the page in a private window and see no red 404 rows in the Network tab
- Every script URL in the page source returns 200
- The Console shows no 'Failed to load resource' errors
- The form submits and the thank-you page or message appears
- Your ad and analytics tags fire (check with Tag Assistant or the Network tab)
- Test from a second network or region
How to prevent it happening again
- Keep at least the last one or two releases' assets available
- Serve HTML with no-cache or a short max-age
- Serve hashed assets with a long immutable cache
- Purge page and CDN caches automatically after each deploy
- Avoid hard-coded hashed file names in templates or tag managers
- Run a quick test of your main forms and checkout after every release
How FunnelGuard handles this
FunnelGuard detects this issue. A robot visitor loads your funnel pages on a schedule and records any script that fails to load. A hashed JS file returning 404 shows up as a failed script in the check.
If a check fails, FunnelGuard re-checks from a second region before sending one alert by email, Slack, Teams, WhatsApp, webhook or PagerDuty. The alert includes a screenshot and a likely cause. It checks the pages and journeys you set up, so it will not see every visitor who holds an old cached page. The Free plan covers 1 site and 2 journeys with daily checks and no card needed.
The page loads, but the missing bundle stops everything that depends on it.
Questions people ask
Why is my JS file returning 404 after a deploy?
Your new release probably removed the old hashed file, but cached HTML still asks for it. The cache can be in a CDN, a page cache plugin, a server or the visitor's browser. Purge the cache and keep old assets for a few days.
How do I fix a stale cached HTML page pointing to old JavaScript files?
Purge your CDN and page caches, then set HTML to no-cache or a short max-age. Keep hashed assets on a long immutable cache. Also keep the previous build's files available after each deploy.
Should I cache HTML and JavaScript for the same length of time?
No. Hashed JS and CSS can be cached for a year because their names change with their content. HTML should be revalidated or cached briefly, because it holds the links to the current hashed files.
Why does my site work for me but not for some visitors after a deploy?
Those visitors may hold older cached HTML, or hit a CDN edge that has not refreshed. You loaded the new page, so you see the new file names. Test in a private window and from other networks.
Will a JS 404 stop my form and tracking from working?
Yes, if the missing file contains the form logic or tag code. The page still looks normal, but buttons do nothing and conversion tags may never send. That is why this issue can cost leads without obvious errors.
How can I tell which script is returning 404?
Open DevTools, go to the Network tab, reload and filter by JS. Failed files show a red 404 status. The Console also lists 'Failed to load resource' with the file URL.
Can FunnelGuard detect a JS bundle 404?
Yes. Its scheduled checks load your funnel pages and flag a script that failed to load. It re-checks from a second region and then sends one alert with a screenshot and a likely cause.
Related issues
- PRF-123ChunkLoadError on lazily loaded routeFix guide
- PRF-130Service worker serving stale or broken cached versionFix guide
- PRF-116Uncaught JavaScript exception on page loadFix guide
- PRF-117Console error on a funnel stepFix guide
- PRF-134Button does nothing on click (dead click)Fix guide
- PRF-133Page stuck on loading spinner foreverFix guide