如何测试冗余资源请求?
当我致力于优化网站时,我一直盯着 Firebug 中的网络面板,看看是否有任何资源(特别是 JavaScript)被多次请求。 (我认识到浏览器在这些情况下可能会使用缓存,但它可能会导致一些奇怪的 JavaScript 效果,例如验证错误的双重警告)。
但网络面板的好坏取决于我的抽查。有没有办法以一种易于执行且不易错过的方式对这些冗余请求进行红旗标记? (它不一定是 Firebug,如果你可以使用 wget、curl、chrome 甚至 IE 有效地完成它,我会尝试一下。)
As I work on optimizing a website, I've been staring at the Net panel in Firebug to see if there are any resources (JavaScript, in particular) being requested more than once. (I recognize that the browser probably uses the cache in these cases, but it might cause some odd JavaScript effects such as a double-warning on a validation error).
But the Net panel is only as good as my spot checking. Is there any way to red-flag these redundant requests in a way that's easy to do and hard to miss? (It doesn't have to be Firebug, if you can do it effectively with wget, curl, chrome, or even IE I'll give it a shot.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想比这更好,请查看 RequireJS。
If you want to go one step better than this, check out RequireJS.