Check browser's cache for a js file

前端 未结 4 1639
予麋鹿
予麋鹿 2020-12-25 09:22

How can I check for a javascript file in user\'s cache. If he refreshed the page or visits the site after sometime. I need not download that js file again. Does the js file

4条回答
  •  佛祖请我去吃肉
    2020-12-25 09:42

    The browser will take care of caching for you.

    When the cache is emptied depends partly on the browser settings and partly on the headers you send. If you set an Expires header, then the browser shouldn't re-request the file until it has expired. Reading about HTTP Headers might help you.

提交回复
热议问题