在什么基础上的JavaScript文件缓存?

编程入门 行业动态 更新时间:2024-10-27 15:18:12
本文介绍了在什么基础上的JavaScript文件缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在什么基础上并JavaScript文件获取缓存?说我从一个网站,并在其他网站上我使用相同的名称M-的script.js',但内容不同加载一个名为M-的script.js的文件。将浏览器获取新的,或者只是看名字,并从缓存加载它?同时为M-的script.js文件的URL是不同的(明显)。结果谢谢你。

On what basis does javascript files get cached? Say I load a file with the name 'm-script.js' from one site and on another website I use the same name 'm-script.js' but with different contents. Will the browser fetch the new one, or just look at the name and load it from the cache? The urls for both the m-script.js file are different (obviously). Thanks.

推荐答案

如果URL是不同的将不被使用的缓存副本。一个新的请求会被提出,而新文件将被下载。

If the url is different the cached copy will not be used. A new request will be made and the new file will be downloaded.

有将是一个的巨大的安全性和可用性问题与浏览器,如果从一个网站上的JavaScript文件缓存使用另一个。

There would be a huge security and usability issue with the browser if a Javascript file cached from one website was used on another.

更多推荐

在什么基础上的JavaScript文件缓存?

本文发布于:2023-10-31 17:16:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546750.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:基础上   缓存   文件   JavaScript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!