Replit changes not showing after deploy? 5 reasons and fixes
Short answer
- A deployment is a snapshot. Changes in the workspace reach the live app only after you select Publish again.
- If you did republish, the old version usually comes from a cached index.html or a service worker.
- Content stored in the database is different in production: editing dev data does not change the live site.
Agent made the change, the preview shows it, you published, and the live app looks exactly the same. It is one of the most viewed questions on the Replit forum. Before asking Agent to redo the work, check these five causes. Each takes a minute.
Symptoms
- The live URL shows an old layout or old text after publishing.
- You see the new version, but a client or a phone still sees the old one.
- Some pages are updated and others are not.
- Content you edited in the app's admin area in the preview does not appear live.
Likely causes
- The change was made after the last publish, or the publish failed and the previous deployment is still live.
- The browser or an intermediate cache keeps an old
index.htmlthat points to old JavaScript files. - A service worker (PWA) serves cached files until it updates.
- The content lives in the database, and you edited development data, not production.
- The custom domain points to another Replit App or an old deployment.
Step-by-step fix
1. Confirm what is live
Open Publishing → History and check the time of the latest successful deployment. If it is older than your change, or the last attempt failed, publish again and read the log.
2. Test without cache
Open the live URL in a private window, or on your phone with Wi-Fi off. If the new version shows there, the problem is caching on your device.
3. Stop caching index.html
Vite and similar tools put a hash in JS and CSS file names, so those can be cached for a long time. The HTML that points to them must not be. Send a no-cache header for HTML responses.
app.use(express.static(distPath, {
setHeaders(res, filePath) {
if (filePath.endsWith(".html")) res.setHeader("Cache-Control", "no-cache");
},
}));
// and in the SPA fallback:
res.setHeader("Cache-Control", "no-cache");
res.sendFile(path.join(distPath, "index.html"));
4. Check for a service worker
In DevTools, open Application → Service Workers. If one is registered and you do not need offline mode, unregister it in code and remove the plugin. If you need it, make it update on new deploys.
5. Check the data source
If the text or images come from the database, they must be changed in production data. Use the app's admin on the live URL, or the Production view of the Database pane.
6. Check the domain
Compare the .replit.app URL and your custom domain. If only the domain is old, it may be attached to another app. Check Publishing → Domains.
Copy-paste prompt for Replit Agent
Open a new Agent chat (a fresh chat keeps old attempts out of its context) and paste this:
After publishing, my live Replit app still shows an old version, even though the preview is up to date.
Please:
1. Add Cache-Control: no-cache for HTML responses (static index.html and the SPA fallback), and long caching only for hashed assets.
2. Check whether a service worker is registered; if offline mode is not needed, remove it and add code that unregisters existing ones.
3. Add GET /api/version that returns the build time, set at build, so I can check which version is live.
Do not change app features.How to verify the fix
/api/versionon the live URL shows the time of your latest publish.curl -I https://your-app/showscache-control: no-cacheon the HTML.- A private window and a phone both show the new version right after the next publish.
If the live app is not only old but broken, go to Replit app works in preview but not after deploy.
FAQ
Does Replit update my live app automatically when I change code?
No. Your published app runs the snapshot from your last publish. Select Publish again to deploy new changes.
Why do my users still see the old version after I republish?
Their browser or a service worker is serving a cached index.html. Send no-cache headers for HTML and remove or update the service worker.
Why is content I changed in the preview missing live?
The preview uses the development database and the published app uses the production database. Content stored as data must be changed in production.