Skip to content

krol44/nuxt-smart-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nuxt-smart-cache

NPM version

About

Nuxtjs 2 module - cache pages on ssr to the disk, anti-ddos

Demo

https://langlija.com - if you press f5 many times, spa mode will be activated

Setup

  1. npm i --save @krol44/nuxt-smart-cache
  2. add to nuxt.config.js
modules: [
  ['@krol44/nuxt-smart-cache', {
    antiDdos: {
      // default true
      enable: true,
      // default - 20 request for 5 seconds and will be locked
      maxRequestsForTime: [20, 5],
      // default 600 seconds
      timeToLockingSsr: 600
    },
    cache: {
      // default true
      enable: true,
      // default - /tmp/nuxt_cache_pages
      pathTempFiles: '/tmp/langlija_cache_pages',
      // default - token
      nameCookieForDisable: 'token',
      // default - true
      rmAllAfterStart: false,
      // default - 3600 seconds
      ttlFile: 3600 * 24 * 10,
      // default - []
      ignorePages: [
        '/',
        /\/dictionary.*/
      ]
    }
  }]
]

License

MIT

About

cache pages on ssr to the disk, anti-ddos

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published