Home

locationreload

Location.reload is a method of the Window Location interface in web browsers that reloads the current document. It can be invoked as window.location.reload(), with an optional boolean argument named forcedReload that affects how the reload is performed.

If forcedReload is true, the request bypasses the browser cache and fetches the page from the origin

Behavior: The call initiates a navigation to the same URL, triggering the page lifecycle events such as

Cross-origin note: Location.reload reloads the current URL on the same origin and does not navigate to a

Alternatives and considerations: To refresh a page without altering history, you can use location.reload() or location.href

server;
if
false
or
omitted,
the
browser
may
serve
the
response
from
its
cache.
The
exact
outcome
can
depend
on
browser
caching
policies
and
server
directives.
beforeunload,
unload,
and
load.
Any
unsaved
user
input
or
application
state
may
be
lost.
The
timing
and
cache
behavior
can
vary
by
browser,
network
conditions,
and
whether
service
workers
or
cache
APIs
are
involved.
different
site.
If
the
current
page
is
loaded
via
a
restricted
context,
policy
and
security
settings
still
apply
to
the
reload
operation.
=
location.href.
To
replace
the
current
page
in
the
session
history
and
avoid
adding
a
new
entry,
use
location.replace(location.href).
Developers
should
consider
user
experience,
data
loss
risk,
and
caching
implications
when
using
reload
in
web
applications.