-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add helpers for other types of content #11
Comments
Yeah this has been on my todo list since I created the package but I haven't found the time yet... I'd be all for a PR if you have the time to do so! Maybe we go for a generic |
Some time in the next few days I will try to get a PR in for a In addition to |
Sounds good. Thanks! |
Hi everyone, I created a PR that supports Fonts, could be useful for you PR: #19 |
I can do a PR for this, but first I wanted to gauge interest.
The
preload
spec that defines server push lists the valid "request destination" types for theas
attribute of theLink
header. Of those, onlyimage
,script
, andstyle
have helpers in this package. While those are likely the most commonly used, I think that we should make it easier for users to specify the other types.There are two ways that I can think of to do this:
pushFile
that has a second argument which defines the type.Here is the example list of types from the documentation (including the three types already supported):
<audio>
and<video>
tags<script>
tags andimportScripts
calls (inside workers)<link rel=stylesheet>
and@import
@font-face
- this should also have atype
attribute which holds the mime type of the font file<img>
,<picture>
,srcset
,imageset
, SVG's<image>
tag, CSS*-image
XHR
,fetch
Worker
,SharedWorker
<embed>
<object>
<iframe>
and<frame>
The spec also defines the following types, but they are not listed in this part of the documentation:
Thoughts?
The text was updated successfully, but these errors were encountered: