@drozd/nuxt-performance

Nuxt high load functional
2,949 14
Install
npm install @drozd/nuxt-performance
Latest Version:1.0.1
License:MIT
Last Updated:Sep 18, 2022
Links: GitHub  ·  npm
Maintainer: drozd

@drozd/nuxt-performance

NPM version

  1. Highload middleware for nuxt's SSR rendering.
  2. Disables SSR in case of a rendering freeze during DDOS, or in case of errors, to try to render on the client.
  3. Selectively enable SSR or SPA mode

Setup

npm install @drozd/nuxt-performance

or

yarn add @drozd/nuxt-performance

then inside your nuxt.config.js add config:

module.exports = {
  performance: {
    renderRouteTimeCallback: (route, ms) => {
      console.log(`time render route: ${route} ${ms} ms`);
    },
    isOnlySPA: (route, _context) => {
      return route === '/personal';
    },
    maxRenderTime: 50,
    maxAttemptSsr: 3, // number of attempts to draw SSR if rendering is slow
    excludeRoutes: /healthcheck/, // regexp exclude routes
    timeDisabledSsrWithRoute: 1000 * 60, // SSR shutdown time after several attempts
    clearSlowCounterIntervalTime: 1000 * 60 * 5, // total counter clear interval
    maxSlowCount: 5 // maximum number of slow requests
  }

  // ...
};

License

MIT

Related Packages

nuxt-request-context

Provide typed request-specific data to Nuxt before the initial render.

979 1
nuxt-ssr-cache

Cache middleware for nuxt's SSR rendering.

126,756 291
@kimyvgy/nuxt-page-cache

Page-level caching module for Nuxt.js (multi-stores).

5,485 30
nuxt-ssr-api-logger

Nuxt module for logging SSR API requests.

22,791 11

Version History

Version Released License
1.0.1 MIT
1.0.0 MIT