Code Monkey home page Code Monkey logo

node-fastify-auto-push's Introduction

Fastify plugin for HTTP/2 automatic server push

This is not an official Google product.

HTTP/2 is a major revision of the HTTP protocol. One of its differences from HTTP/1 is server push, which allows a server to pre-emptively send responses to a client in association with a previous client-initiated request. This can be useful when the server knows the client will need to have those responses available in order to fully process the response to the original request.

It sounds simple and easy but is quite tricky for service developers to manually figure out and configure what resources to push in association with another resource. There are also many pitfalls the implementors must know about. See Rules of Thumb for HTTP/2 Push for the details.

This project is for automating server push and getting rid of the need for manual configurations from service developers. It is a fastify plugin that serves static files and is implemented on top of the h2-auto-push package. It can be thought as a replacement of the fastify-static plugin that supports automatic server-push.

For more details, see the h2-auto-push package.

This package currently works only with Node >=9.4.0.

How to use

import * as fastify from 'fastify';
import {staticServe} from 'fastify-auto-push';
...
const app = fastify({https: {key, cert}, http2: true});
app.register(staticServe, {root: 'path/to/static'});
...

node-fastify-auto-push's People

Contributors

douglascvas avatar greenkeeper[bot] avatar jinwoo avatar mcollina avatar millette avatar ofrobots avatar renovate-bot avatar renovate[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.