This package has been deprecated

Author message:

WARNING: This project has been renamed to next-preload-headers. Install using next-preload-headers instead.

next-link

2.0.0 • Public • Published

next-link

npm version

next-routes helper function copies link preload tags in head of initial response into link header where proxy will server push them. This significantly decreases the initial "time to interactive" latency for first time users.

All routes that are server push enabled must be defined in the next-routes file.

TODO:

  • send/check a cookie with buildId so we know if resources need to be pushed for this build
  • figure out how to make this work without next-routes

Usage

Add it to the express app like this:

const nextLink = require('next-link')
const routes = require("./routes");

const nextLinkRouterHandler = routes.getRequestHandler(app, ({req, res, route, query}) => {
        nextLink(app, req, res, route.page, query);
    }
);

const app = express()

app.use(nextLinkRouterHandler)

Package Sidebar

Install

npm i next-link

Weekly Downloads

240

Version

2.0.0

License

MIT

Unpacked Size

8.55 kB

Total Files

5

Last publish

Collaborators

  • enalmada