3

I am developing a web application in which I need to download a library when the app is getting loaded. Hence I download it using the script tag Now I don;t want it to be downloaded each and every time when I load the app. I need this to be cached. I know that we can do it using jquery, $.ajax(url:..., cache: true).

But is there any way, whether we can cache it without using jquery.

user2733130
  • 157
  • 3
  • 16
  • Does the web server support caching? If yes, then it's already being cached. If you don't know, it's probably already being cached. (Browsers handle caching automatically as long as the server is configured to support caching as well.) – Frxstrem Sep 30 '16 at 05:50
  • use local cache if you want a copy on the client device – madalinivascu Sep 30 '16 at 05:51
  • I am downloading it from the internet..Each time I refresh the browser it downloads, which I don't want to be. – user2733130 Sep 30 '16 at 10:37
  • Maybe you got the *Diable cache* ticked from the Dev window of your browser.. – ezio4df Jan 17 '20 at 13:29
  • Does this answer your question? [caching JavaScript files](https://stackoverflow.com/questions/311062/caching-javascript-files) – Martin Braun Jun 13 '21 at 00:26

1 Answers1

0

You cannot enforce the cache in plain HTML, however, there are plenty of good solutions on our site, including a pure JS solution that uses plain JavaScript without jQuery.

Martin Braun
  • 10,906
  • 9
  • 64
  • 105