This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@nuxt-modules/cache
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@nuxt-modules/cache

@nuxt-modules/cache

npm version npm downloads Github Actions CI Codecov License

Browser and Server Cache module for Nuxt 3

Features

  • Nuxt 3 ready
  • Easy Browser Cache Control middleware
  • Powerful Server Cache with Redis, memcached, etc [Coming soon]
  • TypeScript support

📖  Read the documentation

Setup

yarn add @nuxt-modules/cache # yarn
npm i @nuxt-modules/cache # npm

Basic usage

Firstly, you need to add @nuxt-modules/cache to your Nuxt config.

// nuxt.config.js

{
  buildModules: [
    [
      '@nuxt-modules/cache',
      {
        browser: {
          pages: [
            ['/', { 'max-age': 3600, 'stale-when-revalidate': 10 }],
            ['/product', { 'max-age': 3600, 'stale-when-revalidate': 10 }],
            ['/category', { 'max-age': 3600, 'stale-when-revalidate': 10 }]
          ]
        }
      }
    ]
  ]
}

And that's it! The module is registered and now your pages will have cache-control headers applied.

@nuxt-modules/cache

For more configuration options, please visit the docs

Configuration of server cache will be added in the next versions.

Development

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using yarn dev or npm run dev

License

MIT License

Package Sidebar

Install

npm i @nuxt-modules/cache

Weekly Downloads

27

Version

0.1.0

License

MIT

Unpacked Size

10.9 kB

Total Files

9

Last publish

Collaborators

  • baroshem