1.0.1 • Published 5 years ago
next-lru-cache v1.0.1
next-lru-cache
Little LRU cache for Next.js
Table of Contents
About
Based on this article by Igor Data.
Usage
const express = require('express')
const next = require('next')
const nextLRUCache = require('next-lru-cache')
const app = next({ dev: process.env.NODE_ENV !== 'production' })
app
.prepare()
.then(() => {
const server = express()
nextLRUCache(server, app)
server.listen(3000, err => {
if (err) {
throw err
}
console.log('> Running on port 3000')
})
})
.catch(error => {
console.error(error.stack)
process.exit(1)
})
Install
This project uses node and npm.
It requires express and next as peer dependencies.
$ npm install next-lru-cache
$ # OR
$ yarn add next-lru-cache
Contribute
- Fork it and create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am "Add some feature"
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
License
MIT