First of all, make sure the request are done straight from HTML whenever possible, and not dynamically via JavaScript. Put your JS and CSS requests into <head>
if possible. That way, the preload scanner of the browser will request those files as soon as possible.
Be careful though about where the CSS is placed - see https://csswizardry.com/2018/11/css-and-network-performance/ for more.
If you can't put everything into <head>
of the HTML, you're looking for <link rel="preload">
, which was created exactly for that purpose; it tells the browser to download some resources, but not execute them yet.
Some literature:
Note though that as of late 2018, it's disabled in Firefox, with no ETA when this will ship.
Also, be careful when using preload
as the preloaded requests get the highest priority, which sometimes might mean than other critical but not preloaded resources will wrongly get deprioritized.
In some cases (depending on browser, order of entries in HTML etc.), preload
can lead to double fetches (particularly for webfonts). Make sure to check for that.