HTTP header to detect a preload request by Google Chrome

后端 未结 2 1175
[愿得一人]
[愿得一人] 2020-12-06 16:47

Google Chrome 17 introduced a new feature which preloads a webpage to improve rendering speed upon actually making the request (hitting enter in the omnibar).

Two qu

2条回答
  •  渐次进展
    2020-12-06 17:03

    When Firefox pre-fetches content (at the behest of the referrer page’s markup), it sends the following header with the request: X-moz: prefetch

    Safari does similarly, using: X-Purpose: preview. According to this ticket , Chrome does, too.

    For pre-rendering, Chrome does not send any header whatsoever to the client. Instead, one must use the Page Visibility API, in JS

    source, additional reading

提交回复
热议问题