FIELD

Embodiments of the invention relate to the field of networking; and more specifically, to generating early hints informational responses at an intermediary server.

BACKGROUND

An “early hints” status code is an informational HTTP status code in non-final HTTP responses that provides hints that certain resource(s) may appear in the final response. The early hints status code is defined in Request For Comments (RFC) 8297, titled “An HTTP Status Code for Indicating Hints,” dated December 2017. The early hints status code has been given the number 103. The 103 status code is designed to speed up overall page load times by giving the client an early signal that certain assets may appear in the final response. For instance, after receiving the 103 response, a client can start to fetch the resource(s) indicated in that response before the final HTTP response is received. During this time, the server may be compiling the final response including authenticating the request, making API calls, accessing a database, etc.

Other techniques for conveying this information to the client, such as by using a “preload” link relation, typically cannot be performed by the server until the full HTTP response header is determined. In contrast, a server can send a 103 informational response that includes links to help the client prepare for processing the final response before receiving the full HTTP response.

SUMMARY

An intermediary server responds to a request for an asset handled by an origin server with an informational response. The informational response indicates a set of link header field(s) that reference a set of piece(s) of content that are predicted to be linked within the requested asset when served by the origin server in the final response. The informational response may be generated without the origin server transmitting such an informational response. The generation of these informational responses may be based on analyzing prior full response(s), analyzing a request log, characteristic(s) of the request, characteristics of the potential assets to include in the link header field(s), analyzing other early hints responses, analyzing prior early hints responses from the origin server, and/or configuration by the domain owner. The intermediary server responds to a subsequent client request for the asset with the generated informational response. The requesting client may use the informational response to start fetching the linked resources and/or otherwise prepare for processing the full response. The intermediary server also asynchronously transmits the request to the origin server for the asset. After receiving the full response from the origin server, the intermediary server transmits the full response to the requesting client. The intermediary server uses the full response to determine whether to update or purge the information for the generated informational response for responding to future requests.

