dotvvm icon indicating copy to clipboard operation
dotvvm copied to clipboard

Preloading resources using the Link HTTP header

Open tomasherceg opened this issue 9 months ago • 1 comments

We should consider adding Link HTTP headers to instruct the browser to preload scripts.

tomasherceg avatar Mar 26 '25 15:03 tomasherceg

The header by itself can't help that much compared to the link rel=preload which we already emit. We buffer the entire response, including headers; mainly because at any point there can be an exception which requires us to change status code.

However, it starts making a lot of sense in combination with sending HTTP 103 response. However, there is the question of which when should we send it - which resources will make it into the list. Some controls might be adding resources as late as in PreRender (if it's in Repeater and data is loaded in PreRender as we recommend). I'd say after Init, if you want the resource pre-loaded, then please add it explicitly.

It also seems quite early for this feature, browser support isn't universal, nginx currently lacks support

exyi avatar Apr 13 '25 20:04 exyi