Jitender
Jitender

Reputation: 7969

Is it possible to clear the browser cache using javascript?

Many times we clear user browser cache when a user open our website or we need user permission to do so. However I spend some time on the internet to find any article or something about clearing the cache through javaScript but I did not find any.

Upvotes: 1

Views: 2989

Answers (1)

Mitya
Mitya

Reputation: 34598

No - JavaScript would not have permission to perform this sort of OS-level operation. It is clearly something that only the user should be able to invoke, not a third-party script without their knowledge.

If you have issues with caching, there are approaches to force fresh loads, e.g. by adding random query strings to HREFs/SRCs.

Upvotes: 1

Related Questions