vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

Preloading critical style-sheets for improved performance 🚤

Open sanjaiyan-dev opened this issue 2 years ago • 5 comments

This is inspired from Next.js. Preload critical stylesheets to improve loading speed.

Sorry if I made any mistakes :(

sanjaiyan-dev avatar Sep 11 '22 13:09 sanjaiyan-dev

@brc-dd I use this, LGTM: for example, I also apply some non blocking trick to css resources: https://github.com/vitest-dev/vitest/blob/main/docs/.vitepress/scripts/assets.ts#L40

@sanjaiyan-dev I use this with Link header (server side) to allow the browser to load some resources fast (before browser starts parsing the html)

userquin avatar Sep 13 '22 11:09 userquin

@brc-dd I use this, LGTM: for example, I also apply some non blocking trick to css resources: https://github.com/vitest-dev/vitest/blob/main/docs/.vitepress/scripts/assets.ts#L40

@sanjaiyan-dev I use this with Link header (server side) to allow the browser to load some resources fast (before browser starts parsing the html)

Hi,

So it is already implemented in vitepress ?

sanjaiyan-dev avatar Sep 13 '22 13:09 sanjaiyan-dev

So it is already implemented in vitepress ?

I think no, I should check the code... (my link is from Vitest docs)

userquin avatar Sep 13 '22 14:09 userquin

So it is already implemented in vitepress ?

I think no, I should check the code... (my link is from Vitest docs)

Ohh ok sorry, yh if adding with the header we can use new early hint headers.

sanjaiyan-dev avatar Sep 13 '22 15:09 sanjaiyan-dev

@brc-dd I use this, LGTM: for example, I also apply some non blocking trick to css resources: https://github.com/vitest-dev/vitest/blob/main/docs/.vitepress/scripts/assets.ts#L40

@sanjaiyan-dev I use this with Link header (server side) to allow the browser to load some resources fast (before browser starts parsing the html)

Sorry if I am wrong, in SSG generation I thought better to add link tag than adding header :)

sanjaiyan-dev avatar Sep 17 '22 14:09 sanjaiyan-dev