如何测试预取/预渲染
我已经开始使用预取/预渲染系统加载一些关键资源和页面。
有没有办法确保相关资源确实被预加载?
I have started to load a few key resources and pages using the prefetch/prerender system.
Is there a way to ensure that the resources in question are actually being preloaded?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您还可以使用 prerender-test.appspot.com 来测试您的网站在预渲染下是否正常工作。此外,在 Chrome 中,您可以转到 chrome://net-internals#prerender 查看尝试预渲染的列表以及它们是否已使用,如果未使用,则为何被取消。
You can also use prerender-test.appspot.com to test that your site works correctly under prerendering. Further, from within Chrome, you can go to
chrome://net-internals#prerender
to see a list of attempted prerenders and whether they were used, and if they were not used, why they were canceled.Google 建议使用页面可见性 API 来测试页面是否正在预渲染。我不确定它在跨浏览器上的表现如何(但在 HTML5 中是怎样的)。
Google recommends using the Page Visibility API to test if a page is being prerendered. I'm not sure how well it works cross-browser (but what does in HTML5).