No, location.reload(true) cannot be relied on to force a reload from the server. The optional forceGet parameter is not part of the HTML specification. Only Firefox ever supported it, and other browsers ignore it and treat the call like location.reload(). That plain call reloads the page using the browser’s normal revalidation rules, which may still serve cached resources. To get fresh content reliably, use a cache-busting URL, a fetch call with the right cache mode, or correct server headers.
What does location.reload() do?
The reload() method of the Location object reloads the current URL, like the browser’s Refresh button. The browser sends the request, usually with conditional headers (extra headers asking the server whether the stored copy is still valid), and the server may answer with a short “not modified” response. So the browser can still reuse cached files such as scripts, images and stylesheets when they are considered valid.
Older documentation said that passing true forced a reload from the server instead of the cache. That behavior was non-standard and only Firefox supported it, so it was never a reliable cross-browser feature.

Why is the true parameter deprecated?
The specification defines reload() with no arguments. The old forceGet flag is not in the standard, so browsers have no obligation to honor it. Passing true does not throw an error, which is why many old tutorials still look like they work. In most browsers the argument is simply ignored. Linters such as TSLint (a code-checking tool for TypeScript) warn about it for the same reason.
The javascript:location.reload(true) form, typed in a link or the address bar, runs the same method with the same result.

Does location.reload(true) work in all browsers?
No. Firefox is the only browser that supports the parameter. Elsewhere it is ignored, so code that depends on it behaves differently from browser to browser. The plain reload() method has been available across browsers since July 2015.
How can I force fresh content without the true parameter?
1. Add a cache-busting query string
The simplest approach is to change the URL so the browser sees a new resource. A timestamp or random value in the query string (the part of the URL after the question mark) does this.
const url = new URL(window.location.href);
url.searchParams.set('_r', Date.now());
window.location.replace(url.toString());
Using location.replace() avoids adding an extra entry to the browser history. The Back button therefore still behaves normally. Use location.href instead if you want a new history entry. The query string changes the visible URL, and it only affects the HTML document, not the scripts and images it links to. To refresh an image, give it its own random query string, for example image.jpg?ts=123456789.
2. Use fetch with cache: ‘reload’
When you only need fresh data, not a full page reload, the Fetch API (the built-in way to request data from a server) accepts a cache mode. The value reload makes the browser skip its cache for the request and then update the cache with the response.
const res = await fetch('/api/prices', { cache: 'reload' });
const data = await res.json();
The mode no-store goes further and neither reads nor writes the cache. This updates dynamic content without a full page reload, which gives a more responsive experience.
3. Set Cache-Control headers on the server
The most dependable fix lives on the server, because it controls every visitor, not only the ones running your script. The Cache-Control response header tells browsers how long to keep a file.
Cache-Control: no-cachelets the browser store the file but forces revalidation with the server before reuse.Cache-Control: no-storeforbids storing the response at all, which suits sensitive pages.Cache-Control: max-age=31536000, immutablesuits static assets whose file names change on each build (hashed names), so they never need a forced reload.
For HTML documents, no-cache is a common starting point. For assets, versioned file names are usually better than query strings.
4. Submit a POST request
Some developers submit a hidden form with method="post", because the browser does not reuse cached answers to POST requests the way it does for the GET request that reload() sends. This is a workaround, and it refreshes the page but not necessarily its images.

How do I reload a page in JavaScript?
The standard way is window.location.reload(). Writing location.reload() is equivalent, since location is a property of window. Two other methods reach the same page:
window.location.href = window.location.hrefnavigates to the current URL again and adds a history entry.window.location.replace(window.location.href)loads the URL without keeping the previous entry.
Avoid calling a reload inside loops or timers without a condition, because it can trap the page in an endless refresh cycle. Also note that reload() throws an error if the calling script comes from a different origin than the page, and it may be ignored inside an iframe.
Refresh vs reload: what is the difference?
In everyday language they mean the same thing: load the current page again. Technically, “reload” is the name of the JavaScript method and the browser action, while “refresh” is the common word for the refresh button or the F5 key. The real distinction is the type of reload:
| Action | Cache behavior |
|---|---|
Normal reload (location.reload(), F5) |
Revalidates, may reuse cached resources |
| Hard reload (Ctrl+Shift+R, Cmd+Shift+R) | Bypasses the cache for the page and its resources |
A hard reload is a user action in the browser.
JavaScript cannot trigger it directly, which is why the alternatives above exist.

How do I manually refresh a page?
- Click the browser refresh button next to the address bar, or press F5 (Cmd+R on Mac).
- For a hard reload, press Ctrl+Shift+R (Cmd+Shift+R on Mac), or Ctrl+F5 on many Windows browsers.
- While developing, open the developer tools, go to the Network tab and tick “Disable cache”. Reloading with the tools open then always fetches fresh files. This is also a good way to test cache behavior in your debugging workflow.
When should I reload a page, and when should I avoid it?
A full-page reload discards application state, scroll position and form input, and downloads the page again. Good moments for a reload are a login or logout, a language switch, a changed setting, or recovering from a new deployment.
In a single-page application (SPA, a web app that updates one page instead of loading new ones), updating the data is usually smoother. Options include fetch, AJAX (requesting data in the background), a framework such as React, Vue or Angular, or WebSockets for real-time updates.
Which approach fits you?
If you maintain the server, fix the Cache-Control headers first, since that solves the cause. If you only need updated data in the page, use fetch with cache: 'reload'. Use a query string as a quick workaround when you cannot touch the server. Check your own code base for reload(true) and replace it with one of these before it hides a stale-content bug.
