dana-ross / http2-server-push

WordPress plugin that enables HTTP/2 server push for local JavaScript and CSS resources enqueued in the page.
MIT License
30 stars 5 forks source link

link rel=preload must have a valid `as` value #10

Closed stakeworks closed 8 years ago

stakeworks commented 8 years ago

I got this warning in Chrome "must have a validas` value".

On line 74 the 'as' is set as 'stylesheet' for css files: function http2_link_link_as( $current_hook ) { return 'style_loader_src' === $current_hook ? 'stylesheet' : 'script'; }

This must be 'style', see https://w3c.github.io/preload/#server-push-http-2

https://wordpress.org/plugins/http2-server-push/

dana-ross commented 8 years ago

Well that's lovely. They changed the preload spec to match the server-push semantics. I guess that's actually a good thing.

http://www.w3.org/TR/2015/WD-preload-20150721/ is what I based my code on, but I can simplify some things now that everything is the same across the board.

Thanks for reporting this!