Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krol44/nuxt-smart-cache
cache pages on ssr to the disk, anti-ddos
https://github.com/krol44/nuxt-smart-cache
anti-ddos nodependence nuxt nuxtjs spa ssr
Last synced: about 2 months ago
JSON representation
cache pages on ssr to the disk, anti-ddos
- Host: GitHub
- URL: https://github.com/krol44/nuxt-smart-cache
- Owner: krol44
- Created: 2022-12-03T21:24:46.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-05T01:17:29.000Z (about 2 years ago)
- Last Synced: 2024-10-29T20:57:19.249Z (3 months ago)
- Topics: anti-ddos, nodependence, nuxt, nuxtjs, spa, ssr
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nuxt-smart-cache
[![NPM version](https://img.shields.io/npm/v/@krol44/nuxt-smart-cache)](https://www.npmjs.com/package/@krol44/nuxt-smart-cache)
## 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````javascript
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