HTTP2 Server Push + WOFF2 files

#1

Hi!

There is a problem that I cannot solve. I successfully set up server push a while ago, but Chrome always gives me this error message:

<link rel=preload> has an unsupported 'type' value

This error relates to WOFF2 files. Chrome would prefer this format for server push

Link: <https://fonts.example.com/font.woff2>; rel=preload; as=font; crossorigin; type='font/woff2'

but this is the one that works with Cloudflare:

Link: <https://fonts.example.com/font.woff2>; rel=preload; as=font; type=font

Is anyone managed to get WOFF2 push work with Cloudflare but without any error messages in Chrome?

#2

A Worker preload recipe from Kenton Varda off of StackOverflow

We’ve been serving CSS and JS assets with excellent results.
Well done Kenton!

"</fonts/css/font.css>; rel=preload; as=style; nopush")

Using the absolute path we got the same error as you did
" has an unsupported ‘type’ value"

We got the idea to help new visitors from this recipe


We have not tried web-fonts.

#3

I was getting those errrors in Chrome also. Iused this code in a web.config file and it worked like a champ.

<?xml version="1.0" encoding="utf-8"?>
1 Like
closed #4

This topic was automatically closed after 14 days. New replies are no longer allowed.