Skip to content

mikolaj6r/incremental-regeneration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

incremental-regeneration

npm

About

This middleware adds so-called Incremental Static Regeneration to your server.

More on ISR

Installation

npm i incremental-regeneration

Basic usage

import incrementalRegeneration from 'incremental-regeneration';

// define your server
const server = ...

const myFunctionThatRendersPage = (req, res) => void;

server.use(incrementalRegeneration({
  middleware: myFunctionThatRendersPage,
  revalidateTime: 10
}))
//

Options

revalidateTime (in seconds): time boundary after which the resource will be regenerated

middleware: function that matches type (req: http.ClientRequest, res: http.ServerResponse) => void. This function is expected to render a response and write it to res param.

About

Middleware that enables Incremental Static Regeneration for Node.js-based servers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published