简体   繁体   中英

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.

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, eg by adding random query strings to HREFs/SRCs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM