Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
321 views
in Technique[技术] by (71.8m points)

html - How to only preload required type (woff vs woff2) depending on browser?

I am using the following react-helmet code and I see both woff and woff2 files are preloaded by Firefox (which is inefficient given only woff2 is required).

Is it normal Firefox loads both? How can I tell the browser to only preload required file?

<Helmet
  link={[
    {
      rel: "preload",
      href: "/static/media/open-sans-latin-400.347639ec.woff",
      as: "font",
      type: "font/woff",
      crossOrigin: "anonymous",
    },
    {
      rel: "preload",
      href: "/static/media/open-sans-latin-400.f57a62e9.woff2",
      as: "font",
      type: "font/woff2",
      crossOrigin: "anonymous",
    },
  ]}
/>
question from:https://stackoverflow.com/questions/65909914/how-to-only-preload-required-type-woff-vs-woff2-depending-on-browser

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...