Skip to content

Commit a41285d

Browse files
authored
docs: update references to old fastify-* modules (#100)
1 parent b02b111 commit a41285d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Readme.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# fastify-caching
1+
# @fastify/caching
22

33
![CI](https://github.com/fastify/fastify-caching/workflows/CI/badge.svg)
4-
[![NPM version](https://img.shields.io/npm/v/fastify-caching.svg?style=flat)](https://www.npmjs.com/package/fastify-caching)
4+
[![NPM version](https://img.shields.io/npm/v/@fastify/caching.svg?style=flat)](https://www.npmjs.com/package/@fastify/caching)
55
[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-caching/badge.svg)](https://snyk.io/test/github/fastify/fastify-caching)
66
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)
77

8-
*fastify-caching* is a plugin for the [Fastify](http://fastify.io/) framework
8+
*@fastify/caching* is a plugin for the [Fastify](http://fastify.io/) framework
99
that provides mechanisms for manipulating HTTP cache headers according to
1010
[RFC 2616 §14.9](https://tools.ietf.org/html/rfc2616#section-14.9).
1111

@@ -33,7 +33,7 @@ routes.
3333
```js
3434
const http = require('http')
3535
const fastify = require('fastify')()
36-
const fastifyCaching = require('fastify-caching')
36+
const fastifyCaching = require('@fastify/caching')
3737

3838
fastify.register(
3939
fastifyCaching,
@@ -72,8 +72,8 @@ const abcache = require('abstract-cache')({
7272

7373
const fastify = require('fastify')()
7474
fastify
75-
.register(require('fastify-redis'), {client: redis})
76-
.register(require('fastify-caching'), {cache: abcache})
75+
.register(require('@fastify/redis'), {client: redis})
76+
.register(require('@fastify/caching'), {cache: abcache})
7777

7878
fastify.get('/', (req, reply) => {
7979
fastify.cache.set('hello', {hello: 'world'}, 10000, (err) => {
@@ -91,7 +91,7 @@ fastify.listen(3000, (err) => {
9191

9292
### Options
9393

94-
*fastify-caching* accepts the options object:
94+
*@fastify/caching* accepts the options object:
9595

9696
```js
9797
{
@@ -111,7 +111,7 @@ then `', max-age=<value>'` will be appended to the `cache-control` header.
111111
protocol compliant cache object. Note: the plugin requires a cache instance to
112112
properly support the ETag mechanism. Therefore, if a falsy value is supplied
113113
the default will be used.
114-
+ `cacheSegment` (Default: `'fastify-caching'`): segment identifier to use when
114+
+ `cacheSegment` (Default: `'@fastify/caching'`): segment identifier to use when
115115
communicating with the cache.
116116
+ `serverExpiresIn` (Default: `undefined`): a value, in seconds, for the length of time the resource is fresh and may be held in a shared cache (e.g. a CDN). Shared caches will ignore max-age when this is specified, though browsers will continue to use max-age. Should be used with expiresIn, not in place of it. When this is set, and `privacy` is set to `public`, then `', s-maxage=<value>'` will be appended to the `cache-control` header.
117117

0 commit comments

Comments
 (0)