I'm trying to optimise the speed of some web page by adding the Link HTTP header to instruct the browser to preload some assets and data that is used on the web page. However, most visitors will get redirected first, before they get to the actual HTML page.
Does it make sense to already include the Link header in the response that contains the redirect? Or will the browser not use those assets for the redirected page anyway, so can I better leave them out to prevent unnecessary requests?
Example
The user first opens /initial, and gets redirected from there:
GET /initial HTTP/1.1
HTTP/1.1 302 Found
Link: </static/css/bundle.css>; rel=preload; as=style
Location: /final
The browser then follows the redirect to /final:
GET /final HTTP/1.1
HTTP/1.1 200 OK
Link: </static/css/bundle.css>; rel=preload; as=style
<html>
<link rel="stylesheet" href="/static/css/bundle.css">
...
So, does it make sense that the Link header is already included in the first 302 response, or can I better leave it out there?