Your Search Bar For Shrewd Tips

How Do I Clear Js Cache In Chrome?


If a website keeps showing old content, a JavaScript change does not appear, or a page behaves incorrectly after an update, Chrome may be loading a cached version of a file. The quickest fix is usually a hard reload. If that does not work, you can clear Chrome’s cached files, remove a site’s stored data, or check whether a service worker is serving an older version. The right method depends on what is being cached, so start with the least disruptive option and work through the steps below.

How Do I Clear JS Cache in Chrome?

To clear the JavaScript cache in Chrome, first try a hard reload of the page. On Windows or Linux, press Ctrl + Shift + R. On a Mac, press Command + Shift + R. This tells Chrome to reload the current page while revalidating or re-fetching its resources, including JavaScript files, rather than relying on the usual page cache.

If a hard reload does not help, open Chrome’s settings and delete cached files. Enter chrome://settings/clearBrowserData in the address bar, select a time range, check Cached images and files, and choose Delete data. This clears cached resources across sites, not just JavaScript. It normally keeps your bookmarks and saved passwords, but be sure to leave options such as cookies unchecked if you do not want to sign out of websites.

For a problem limited to one website, use Chrome DevTools to bypass the cache or clear that site’s stored data. These targeted options can help when the page uses a service worker or browser storage in addition to the regular HTTP cache.

What Does JavaScript Cache Mean in Chrome?

Chrome does not have one single “JavaScript cache” setting. When you visit a website, the browser may store its JavaScript files in its general HTTP cache, just as it stores images, stylesheets, and other resources. The site’s server tells Chrome how long those files can be reused through caching rules.

A website can also store files and information using a service worker, Cache Storage, or other browser storage. A service worker is a small script that can handle network requests for a site. It may help the site load quickly or work offline, but an outdated service worker can sometimes return an older JavaScript file even after you refresh the page.

That is why clearing cached images and files may not fix every problem. The page may be receiving an old file from a service worker, a website’s own storage, a proxy, or a content delivery network (CDN). A step-by-step approach helps identify which layer is responsible.

Method 1: Hard Reload the Page

A hard reload is the best first step when one page looks outdated. It asks Chrome to reload the page’s resources rather than simply displaying the current page from its normal cache. It does not delete all browser data, so it is a quick and low-impact option.

  • Windows or Linux: Press Ctrl + Shift + R or Ctrl + F5.
  • Mac: Press Command + Shift + R.

After the reload, check whether the JavaScript-powered feature works as expected. If it does not, try the developer tools method below. A hard reload may not remove a site’s service worker or its separately stored files, so it is not always enough.

Method 2: Disable the Cache with Chrome DevTools

Chrome DevTools includes a setting that prevents the browser’s regular cache from being used while DevTools is open. This is especially useful for developers testing a new JavaScript build or checking whether a page is loading the latest files.

  • Open the page that is showing the problem.
  • Open DevTools by pressing F12 or Ctrl + Shift + I on Windows or Linux. On a Mac, press Command + Option + I.
  • Select the Network tab.
  • Check Disable cache.
  • Keep DevTools open and reload the page.

The setting applies only while DevTools remains open. Close DevTools and Chrome returns to its normal caching behavior. This makes it convenient for testing, but it is not a permanent way to clear cached data for everyday browsing.

You can also right-click the reload button while DevTools is open to see additional reload options, such as an empty-cache reload, depending on the Chrome version. If you do not see this menu, use the Disable cache checkbox or clear cached files through Chrome settings instead.

Method 3: Clear Cached Files in Chrome Settings

Use this method if several pages are affected or a hard reload has not solved the issue. Clearing cached files removes temporary copies that Chrome has saved for websites. The browser will download fresh versions the next time you visit those pages, which may make the first reload slightly slower.

  • Open Chrome and enter chrome://settings/clearBrowserData in the address bar.
  • Choose a time range. Select All time if you want to remove all cached files.
  • Check Cached images and files.
  • Leave other boxes unchecked if you only intend to clear the cache.
  • Select Delete data, then reload the affected website.

On some Chrome versions, you can reach the same screen by selecting the three-dot menu, choosing Delete browsing data, and opening the basic or advanced options. The wording and layout may differ slightly between desktop and mobile versions.

Clearing cookies and other site data is a separate action. Cookies can keep you signed in and store preferences, so deleting them may log you out or reset website settings. If your goal is only to refresh JavaScript, start by clearing Cached images and files and leave cookies and site data alone.

Method 4: Clear Data for One Website

If only one website is causing trouble, you can clear data for that site instead of removing cached files for every site. This is a useful option when you want to limit the disruption to your browser sessions and preferences.

In Chrome, open Settings, go to Privacy and security, and look for Site settings or the option to view site data, depending on your Chrome version. Search for the website’s domain, open its stored data entry, and choose the option to delete or clear its data. You can also open the site, select the icon to the left of its address, and review the site’s permissions or data options when available.

Deleting site data may remove more than cached JavaScript. It can also delete cookies, local storage, and saved site preferences for that domain. You might need to sign in again. Once the data is cleared, close and reopen the page so Chrome can request fresh resources.

Clear a Service Worker and Cache Storage

If a website still serves old JavaScript after you clear the regular cache, a service worker may be involved. This is common with progressive web apps and sites designed to work offline. You can inspect and remove the service worker for a specific site using DevTools.

  • Open the affected website and launch Chrome DevTools.
  • Select the Application tab. If it is not visible, select the double-arrow or more-tabs menu.
  • Choose Service Workers in the sidebar.
  • Select Unregister beside the site’s active service worker.
  • Open Storage or Clear storage in the sidebar and review the available site data options.
  • If necessary, clear the site’s Cache Storage, then reload the page.

DevTools labels can change between Chrome releases. Clearing storage may remove local data used by the website, and unregistering a service worker can affect offline behavior until the site registers it again. Use these steps for the affected site rather than clearing storage indiscriminately across websites.

Clear the JavaScript Cache on Android

On Android, you can clear Chrome’s cached files through the app. Open Chrome, tap the three-dot menu, and choose Delete browsing data. Select a time range, check Cached images and files, and confirm the deletion. Avoid selecting cookies or other site data unless you are comfortable signing in again.

For an issue affecting one website, Chrome may offer site-specific data controls from its site settings. Open Chrome’s settings, find Site settings, and review the relevant site’s stored data or permissions. The exact route can vary by Android and Chrome version. After clearing the data, return to the site and reload it.

What About Chrome on iPhone or iPad?

Chrome on iOS has a different browser-engine and system environment from desktop Chrome, so desktop DevTools instructions do not apply in the same way. To remove cached files, open Chrome’s menu, choose Delete browsing data, select a time range, and choose the cached files option if it is shown. Confirm the deletion and revisit the page.

Because mobile menus and available data categories can change between app versions, check the options displayed on your device. If the site remains outdated, close and reopen Chrome, update the app, and check whether the website itself has a service-worker or server-side caching issue.

How to Tell Whether the Cache Is the Problem

Cache is a likely cause when a site works in another browser or device, but not in your current Chrome session. It is also worth checking when a developer says a new version is live but your browser still shows an old interface or old behavior. However, JavaScript errors can also come from a faulty deployment, a broken script, an extension, or a server configuration issue.

Try opening the page in an Incognito window as a quick comparison. Incognito uses a separate, temporary browsing session and generally does not reuse the regular window’s cookies and site data. If the page works there, cached data, an extension, or a saved site setting in your regular profile may be involved. Incognito is a troubleshooting test, not a guaranteed way to bypass every form of caching.

Developers can use the DevTools Network tab to inspect the JavaScript file and see whether it came from memory cache, disk cache, or the network. If Chrome downloads the latest file but the page still behaves incorrectly, the issue may be in the code or deployment rather than the browser cache.

Prevent Old JavaScript from Appearing Again

If you manage the website, avoid relying on visitors to clear their browser cache after every update. A common approach is to give each build a unique filename or versioned URL, such as a file containing a content hash. When the JavaScript changes, its URL changes too, so Chrome can request the new file while still caching unchanged assets efficiently.

Review the site’s HTTP cache headers and service-worker update strategy as well. Long-lived caching can be appropriate for files with versioned names, while the main HTML document may need shorter caching or revalidation so it can point to the current build. If the problem affects many users, ask the site’s developer or hosting provider to check the CDN and server configuration before telling everyone to erase browser data.

Conclusion

To clear JS cache in Chrome, begin with a hard reload using Ctrl + Shift + R on Windows or Linux, or Command + Shift + R on Mac. If that does not work, disable the cache in DevTools while testing or delete Cached images and files through Chrome’s browsing data settings. For a single website, inspect its site data and service worker. Use the least disruptive fix first, since clearing cookies or all site storage can sign you out and reset preferences. If fresh files still do not load after these steps, the cause may be the website’s service worker, server, or CDN rather than Chrome’s ordinary cache.


Disclaimer: Articles are written by Humans, AI or Both. Verify Important information.

Shrewdnia

Shrewdnia

Shrewdnia is a destination for curious minds seeking clarity, knowledge, and informed perspectives. Through insightful articles and practical guides our passionate team explores a wide range of topics designed to help readers understand the world around them, make smarter decisions, and stay informed in an ever-changing landscape.


💡 Every question sparks discovery, and every perspective enriches the conversation. Share your thoughts and insights in the comments 👇

Back to blog

Leave a comment

JOIN THE SHREWDNIA COMMUNITY FORUM

What do you think?

Have an opinion, experience, or question about this topic? Join the Shrewdnia Forum and share your thoughts with other readers.

Join the Forum →