Website Showing Old Content After Deployment? How to Fix It
You have updated your website, uploaded the latest files, and completed the deployment. However, when you open the website in your browser, the old content is still there. The new design may be missing, recent changes may not appear, or some pages may show a mixture of old and new elements.
If your website is showing old content after deployment, the problem does not necessarily mean that the deployment failed. Browsers, content delivery networks (CDNs), server-side caching systems, application caches, and incorrect deployment paths can all cause visitors to receive an older version of a website.
The key is to identify which layer is serving the outdated content rather than clearing every cache or uploading the files again without investigation.
In this guide, you will learn how to diagnose stale website content, inspect HTTP responses, clear the correct cache, verify deployment paths, and prevent the same issue from happening again.
Why Is My Website Showing Old Content After Deployment?
Several different components can store or serve previously generated website content.
Common causes include:
- Browser caching of HTML, CSS, JavaScript, or images.
- CDN caching of pages and static files.
- Server-side page caching.
- Application caches containing outdated data or configuration.
- Old files remaining in the active document root.
- Deployments targeting the wrong directory or server.
- Service workers serving cached resources.
- Incorrect cache headers or asset versioning.
- Multiple application instances running different code versions.
A useful first step is to determine exactly what remains outdated. If the page text is old, HTML or application caching may be involved. If the text is updated but the design is not, an old CSS or JavaScript asset is a more likely explanation.
1. Check Whether the Browser Is Serving Cached Content
Browsers cache resources such as images, stylesheets, JavaScript files, and sometimes HTML documents. This reduces loading time, but it can make recent changes difficult to see.
Test the website in a private browsing window
Open the affected URL in a private or incognito window. You can also test it in another browser or on a different device.
If the updated content appears there but not in your usual browser, browser-side caching is a strong possibility.
A hard refresh may also help:
- Windows/Linux: Press
Ctrl + Shift + Rin many browsers. - macOS: Press
Command + Shift + Rin many browsers.
The exact shortcut can vary by browser.
Clear the relevant browser cache
If a hard refresh does not help, clear cached files and images for the affected website. You generally do not need to delete all browsing data or saved passwords.
However, if every browser displays the same old content, continue investigating. The problem may be coming from a CDN, application cache, or server.
2. Check CDN Caching
A content delivery network caches website resources on distributed servers closer to visitors. This improves performance and reduces requests to the origin server.
However, if the CDN still holds an older version of a page or asset, visitors may continue receiving that version after deployment.
How to identify a CDN cache issue
Use browser developer tools or curl to inspect the response headers.
For example:
curl -sS -D - -o /dev/null https://example.com/
This command displays the response headers without printing the response body.
Look for headers such as:
Cache-Control: public, max-age=3600
Age: 1200
An Age header may indicate how long a response has been cached by a shared cache. Some CDNs also provide provider-specific headers that indicate whether a response was a cache hit or miss.
Header names and meanings vary between providers, so their presence or absence alone does not prove that a CDN is responsible.
How to fix stale CDN content
- Sign in to your CDN dashboard.
- Locate the cache management or purge section.
- Purge the affected URL or specific outdated assets.
- If the issue affects many resources, consider a broader purge.
- Recheck the URL and response headers after the purge.
Avoid purging the entire CDN cache unnecessarily. A full purge can increase requests to the origin server while the cache is being repopulated.
If the CDN continues serving outdated content, check its cache rules, origin configuration, and whether the purge completed successfully.
3. Clear Server-Side and Application Caches
Many websites generate pages dynamically and cache the results. Instead of running the application and database queries for every visitor, the server may return a previously generated response.
This behavior is common in content management systems, PHP applications, and performance-optimized hosting environments.
Even after the application files are updated, a cached response can continue displaying the previous version.
WordPress page caching
If the website runs WordPress, caching may be provided by a plugin, the hosting environment, or a CDN.
A typical troubleshooting sequence is:
- Purge the cache in the active WordPress caching plugin.
- Clear any server-level cache available through the hosting control panel.
- Purge the CDN cache if one is configured.
- Reload the affected page and check the result.
Plugin names and available controls depend on the installed setup. Do not install an additional caching plugin just to clear a cache that is managed by the hosting provider.
PHP OPcache
PHP OPcache stores compiled PHP bytecode in memory so PHP scripts do not need to be compiled from source on every request.
Under certain configurations, OPcache can contribute to stale code being executed after deployment. For example, timestamp validation may be disabled or revalidation may be delayed.
If the application is executing old PHP code, ask the hosting provider or server administrator to verify OPcache configuration and reload or reset the appropriate PHP runtime cache safely.
On shared hosting, you may not have permission to manage the PHP runtime directly. Avoid restarting production services or using scripts that attempt to reset server-wide caches without authorization.
Framework and application caches
Frameworks and custom applications may cache configuration, routes, templates, or generated data.
For Laravel applications, for example, configuration and route caches can affect application behavior after changes. Use the cache-management commands appropriate to the deployed application and environment.
Do not clear every application cache indiscriminately. Some caches contain important performance data, and the correct procedure depends on the framework and deployment process.
4. Verify the Deployment Directory
One of the easiest problems to overlook is deploying files to the wrong directory.
A server can contain multiple website directories, staging copies, release folders, or document roots. Uploading the latest files does not help if the live domain serves content from another location.
Check the active document root
On a cPanel account, open Domains and inspect the document root associated with the affected domain.
A typical directory structure might look like this:
/home/account/
├── public_html/
├── staging/
└── releases/
├── release-01/
└── release-02/
The active website may use public_html, a subdirectory, or a configured release path. The directory structure alone does not identify which one is live.
Compare the configured document root with the directory used by your deployment process.
Verify the actual files
If you have authorized shell access, inspect the expected deployment directory:
pwd
ls -lah
To check a particular file:
stat public/index.html
Replace the example path with the actual file location.
The file modification time can help establish whether the expected file was updated. It does not prove that the live website is serving that file, so compare it with the configured document root and the content returned over HTTP.
If the deployment tool uploaded files successfully but the live site remains unchanged, check the deployment destination, active release symlink, domain configuration, and web server routing.
5. Check Whether CSS and JavaScript Files Are Outdated
Sometimes the website’s HTML is current, but its appearance or interactive features remain broken.
This can happen when a browser or CDN loads an older stylesheet or JavaScript bundle after a new deployment.
For example, the HTML might reference:
<link rel="stylesheet" href="/assets/app.css">
<script src="/assets/app.js"></script>
If the browser reuses an older cached version of either file, the page may combine updated HTML with outdated styles or scripts.
Inspect the loaded assets
- Open the website in your browser.
- Open Developer Tools.
- Select the Network tab.
- Reload the page.
- Find the relevant CSS and JavaScript requests.
- Inspect their URLs, response status, response headers, and response content.
If the browser shows that an asset was served from memory or disk cache, compare the loaded version with the file currently deployed on the server.
Use versioned asset filenames
A more reliable solution is to generate unique filenames for assets when their contents change.
For example:
/assets/app.a82f31.css
/assets/app.91bd72.js
These filenames are illustrative. In a real build pipeline, a hash or version identifier should be generated from the actual asset content.
When the file changes, the new HTML references a new filename. This reduces the chance that the browser or CDN will reuse an older asset under the same URL.
For frequently updated HTML, use cache headers that allow the document to be revalidated, while static assets with content-hashed filenames can often be cached for longer periods.
6. Check HTTP Cache-Control Headers
HTTP response headers influence whether browsers and shared caches can store a response and when they should revalidate it.
For example:
Cache-Control: public, max-age=86400
This permits shared caching and allows the response to be considered fresh for up to one day, subject to applicable HTTP caching rules.
For HTML pages that need to reflect frequent deployments, a policy that requires revalidation may be more appropriate:
Cache-Control: no-cache
Despite its name, no-cache does not mean that a response can never be stored. It generally means that a stored response must be validated before reuse.
By contrast:
Cache-Control: no-store
instructs caches not to store the response. This may be appropriate for certain sensitive responses but is not a default recommendation for every page.
How to inspect cache headers
Run:
curl -sS -D - -o /dev/null https://example.com/
Review headers such as Cache-Control, ETag, Last-Modified, Age, and any CDN-specific cache status headers.
The correct policy depends on the type of content. Do not disable all caching across the website just to solve one stale page.
7. Check Service Workers and Progressive Web Apps
Websites that use service workers can cache pages and assets independently of the normal browser HTTP cache.
A service worker may continue returning a cached response after new files have been deployed, particularly if its update process or cache versioning is incorrect.
This is especially relevant to progressive web apps and websites that offer offline functionality.
How to investigate
- Open the browser’s Developer Tools.
- Locate the Application panel in supported browsers.
- Open the service worker section.
- Check whether a service worker controls the affected page.
- Inspect the registered worker and its update status.
- Review the application’s cache update strategy.
For diagnosis, you can test with the service worker temporarily bypassed or unregister it in a test browser profile.
Do not permanently remove a service worker without understanding what it controls. It may provide offline support, push notifications, or other required functionality.
A lasting fix usually involves updating the service worker’s cache versioning and activation process so new deployments replace obsolete cached resources correctly.
8. Check Whether Multiple Servers Are Serving Different Versions
Websites behind load balancers, reverse proxies, or multi-server deployments may send requests to different application instances.
If only some requests return the updated content, one server may have the new release while another is still running the previous version.
How to diagnose inconsistent responses
Compare repeated requests to the same URL:
for i in $(seq 1 10); do
curl -sS https://example.com/version.txt
echo
done
This example assumes that /version.txt exists and contains a harmless release identifier. Do not create a publicly accessible file containing secrets or internal configuration.
If the output changes between requests, investigate whether multiple backends, caching layers, or deployment states are involved. A changing response is evidence worth investigating, not definitive proof of a load-balancer problem.
For multi-server deployments, verify that:
- Every application instance received the intended release.
- The load balancer points to the correct backends.
- Old instances have been removed or updated.
- Shared caches and release symlinks are consistent.
- The deployment process completed on every target server.
Avoid exposing internal server names, private addresses, or sensitive version information through public diagnostic endpoints.
9. Check Environment and Configuration Differences
A deployment can update the code without updating the environment or configuration used by the live application.
For example, a website might continue using old database data, an outdated API endpoint, or configuration values loaded before deployment.
Possible causes include:
- Environment variables were not updated.
- Configuration caches were not rebuilt.
- The application is connected to a different database.
- A staging environment was updated instead of production.
- A long-running worker still has the previous configuration loaded.
Compare the deployment environment with the intended production configuration. Verify the active database and application settings without printing passwords, API keys, or other secrets into logs or public pages.
If the website uses persistent workers or background processes, follow the application’s deployment documentation to reload them safely.
10. Use a Step-by-Step Troubleshooting Workflow
When the website continues displaying old content, use a controlled process instead of repeatedly uploading files or clearing every cache.
Step 1: Confirm the change was deployed
Verify the deployment result and check the expected file or release. Confirm that the deployment targeted the intended environment.
Step 2: Compare the response with the expected version
Use a private browser window and inspect the HTTP response. If possible, compare a known page element or harmless version identifier.
Step 3: Inspect the browser’s Network panel
Determine whether the outdated content comes from HTML, CSS, JavaScript, an image, or an API response.
Step 4: Inspect response headers
Check cache-related headers and any provider-specific CDN cache status indicators.
Step 5: Purge the relevant cache
Clear only the cache layer identified during diagnosis: browser, CDN, server, application, or service worker.
Step 6: Verify the active deployment path
Confirm the domain’s document root, release directory, application instance, and deployment target.
Step 7: Investigate multi-server and runtime issues
If the result remains inconsistent, check load-balanced backends, PHP OPcache where applicable, application workers, and environment configuration.
Step 8: Test again
Repeat the original request and verify that the updated content is consistently served. Check both the visible page and its dependent assets.
How to Prevent Old Content After Future Deployments
The best long-term solution is to design the deployment and caching strategy together.
Follow these practices:
- Use versioned assets. Generate content-hashed filenames for CSS, JavaScript, and other versioned static resources.
- Configure appropriate cache headers. Use policies that match the update frequency and sensitivity of each resource.
- Automate cache invalidation. Purge relevant CDN or application caches as part of the deployment pipeline when necessary.
- Verify deployment paths. Ensure every release targets the correct domain, directory, and environment.
- Deploy consistently across servers. Use a controlled release process for all application instances.
- Handle application caches deliberately. Run the appropriate framework-specific commands as part of deployment.
- Manage service workers carefully. Version cached resources and test update behavior.
- Use health checks and release identifiers. Confirm that the intended version is active without exposing sensitive internal details.
- Keep a rollback plan. Preserve a known-good release so you can recover quickly if a deployment introduces a problem.
A reliable deployment process should not depend on visitors manually clearing their browser caches every time the website changes.
Final Thoughts
When a website is showing old content after deployment, the cause can be anywhere between the visitor’s browser and the application’s active release. Browser caching, CDN rules, server-side caches, outdated assets, service workers, and incorrect deployment paths can all produce similar symptoms.
Start by identifying which resource is outdated, inspect the response and its cache headers, and verify that the live domain is serving the intended release. Then fix the specific cache or deployment layer responsible for the problem.
With appropriate cache policies, versioned assets, consistent deployments, and a repeatable verification process, you can reduce stale-content issues and make future website updates more predictable.
