# @krol44/nuxt-smart-cache

> Cache pages on ssr, anti-ddos

Latest version **1.0.5** (published 2022-12-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @krol44/nuxt-smart-cache
pnpm add @krol44/nuxt-smart-cache
yarn add @krol44/nuxt-smart-cache
bun add @krol44/nuxt-smart-cache
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-12-05 |
| First published | 2022-12-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | krol44 |
| Maintainers | krol44 |
| Keywords | nuxt, ssr, vue, spa, cache, anti-ddos |

## Links

- npm: https://www.npmjs.com/package/@krol44/nuxt-smart-cache
- Repository: https://github.com/krol44/nuxt-smart-cache
- Homepage: https://github.com/krol44/nuxt-smart-cache#readme
- Issues: https://github.com/krol44/nuxt-smart-cache/issues
- npm.io page: https://npm.io/package/@krol44/nuxt-smart-cache

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2022-12-05
- 1.0.4 — 2022-12-04
- 1.0.3 — 2022-12-03
- 1.0.2 — 2022-12-03
- 1.0.1 — 2022-12-03

## 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

---
_Source: https://npm.io/package/@krol44/nuxt-smart-cache · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
