sebastian-software / edge

The Lerna Repository for Edge Platform
Apache License 2.0
33 stars 7 forks source link

Add support for preloading webfonts through "link" tags #11

Open swernerx opened 6 years ago

swernerx commented 6 years ago

Initially required CSS is already added to the head section. Together with the web font hints the browser should be able to parallize loading of assets even more which improves initial rendering time.

Our React server should be in the position to add <link rel="preload" ...> tags to the head section of the generated HTML. It could use the assets file which is exported by Webpack. We could start with a simple implementation only preloading .woff2 files but could in theory also add some basic client detection to use .woff2 for modern browsers while using .woff for all others as a fallback.