Skip to content

Next.js hook which gives developers control over when to warm up a specific serverless / SSR route.

Notifications You must be signed in to change notification settings

lws803/next-use-warmroutes

Repository files navigation

Next.js Warm Routes

Next.js useWarmRoutes hooks ensures that your routes are warm so that you never have to start from a cold start again.

Define a route mapping to ensure that a list of routes gets called with a pre-flight request when the current route matches the route defined in the object.

Usage

// Use this at the root of your Next.js application, _app.tsx for maximum effectiveness.
useWarmRoutes({
  "/*": ["/articles/*", "/api/articles"],
});

Note: keys defined in this object should be glob patterns.

About

Next.js hook which gives developers control over when to warm up a specific serverless / SSR route.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published