对于我的cryptocurrency market data website
- 我在Cloudlare上有enabled early hints
- 我正在生成有关SvelteKit/Vite Web服务器钩子的早期提示
- 我已验证HTTP回复中是否存在
Link
标头
Link: </fonts3.css>; rel="preconnect", </_app/assets/start-6f5e0715.css>; rel="preconnect", </_app/assets/pages/__layout.svelte-f31b19cc.css>; rel="preconnect", </_app/assets/pages/index.svelte-84a34be8.css>; rel="preconnect"
- 我已启用Chrome命令行标志以尊重早期提示
现在,我如何验证
- Cloudflare正在正确生成
HTTP/1.1 103 Early Hints
。我可以用curl
或wget
显示此信息吗? - Chrome尊重早期的提示--这是在webr开发者工具的性能标签中显示的,还是在其他地方?
3条答案
按热度按时间yhived7q1#
I have no luck to verify Chrome's response from Chrome's devtool. When I monitor the network traffic, Chrome devtool does not show 103 responses at all. However, I am able to verify the server 103 responses using curl. Here is a curl output sample:
$ curl -k -v —http2 https://evanella.org
...
GET / HTTP/2 Host: evanella.org User-Agent: curl/7.64.1 Accept: /
...
< HTTP/2 103
< link: https://evanella.org/ ; rel=preload;
< link: https://evanella.org/wp-content/themes/twentytwentytwo/assets/fonts/SourceSerif4Variable-Roman.ttf.woff2 ; rel=preload; as=font
< link: https://evanella.org/wp-content/themes/twentytwentytwo/assets/images/flight-path-on-transparent-d.png ; rel=preload; as=image
< link: https://evanella.org/wp-content/themes/twentytwentytwo/style.css?ver=1.1 ; rel=preload; as=style
< link: https://evanella.org/wp-includes/blocks/navigation/view.min.js?ver=3776ea67846b3bb10fe8f7cdd486b0ba ; rel=preload; as=script
...
< HTTP/2 200
< server: h2o/2.3.0-DEV@998a7fb7b
< content-type: text/html; charset=UTF-8
< link: https://evanella.org/wp-json/ ; rel="https://api.w.org/"
< vary: Accept-Encoding
BTW, I configured my own webserver to generate the 103 early hints responses.
7tofc5zh2#
此网站是一个在线工具,用于测试是否提供了早期提示:
https://code103.hotmann.de
uklbhaso3#
在chrome中,您可以在控制台中输入以下内容:
performance.getEntriesByName('https://yourwebsite.com/image.jpg')[0].initiatorType
,其将分别输出link
或early-hints
(可能是更多的值等),在early-hints
的情况下,其指示由103报头发起的特定资源下载。在我的情况下,我在接收
link
时卡住了,而early-hints
是预期的。如果我在调试过程中了解到更多信息,我将更新此响应。