Skip to content
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 optional directives for Link headers #34

Closed
wants to merge 4 commits into from
Closed

Add optional directives for Link headers #34

wants to merge 4 commits into from

Conversation

SamyPesse
Copy link
Contributor

The W3C spec defines some directives such as nopush: https://www.w3.org/TR/preload/#server-push-http-2

And some CDNs (such as Fastly) supports it to control the behaviour of the CDN (they also support other directives such as x-http2-push-only).

This PR adds an option directives to define these directives:

express()
  .use(netjet({
    directives: ['nopush']
  }))
  .use(express.static(root))
  .listen(1337);

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 96.429% when pulling 4812167 on SamyPesse:directive-nopush into e1a09af on cloudflare:master.

4 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 96.429% when pulling 4812167 on SamyPesse:directive-nopush into e1a09af on cloudflare:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 96.429% when pulling 4812167 on SamyPesse:directive-nopush into e1a09af on cloudflare:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 96.429% when pulling 4812167 on SamyPesse:directive-nopush into e1a09af on cloudflare:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 96.429% when pulling 4812167 on SamyPesse:directive-nopush into e1a09af on cloudflare:master.

@coveralls
Copy link

coveralls commented Jan 29, 2018

Coverage Status

Coverage increased (+0.04%) to 96.429% when pulling 93e647c on SamyPesse:directive-nopush into e1a09af on cloudflare:master.

@terinjokes terinjokes self-assigned this Feb 6, 2018
@terinjokes
Copy link
Contributor

Thanks @SamyPesse, sorry I didn't see the notification until now. Both the Preload specification and Fastly's documentation refer to these as "attributes". How did you decide on "directive"?

@SamyPesse
Copy link
Contributor Author

No worries :)

I've focused on this sentence:

If used with the nopush directive
https://docs.fastly.com/guides/performance-tuning/http2-server-push

But you are right that attributes may be a better name (like the DOM attributes), I'll make the change.

@SamyPesse
Copy link
Contributor Author

@terinjokes done :)

@terinjokes
Copy link
Contributor

How does 7900bd5 look?

@SamyPesse
Copy link
Contributor Author

👍

@terinjokes
Copy link
Contributor

Merged as 7900bd5. Packaging it up as 1.3.0 now.

@terinjokes terinjokes closed this Feb 6, 2018
@SamyPesse SamyPesse deleted the directive-nopush branch February 6, 2018 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants