Fastify Response Caching
Description
A Fastify plugin for caching the response
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
fastify-response-caching

*fastify-response-caching* is a plugin for the [Fastify](http://fastify.io/) framework that provides mechanisms for caching response to reduce the server workload.
By default, this plugin implements caching by request URL (includes all query parameters) with the caching time (TTL) is 1 seconds. Besides, this plugin also supports additional caching condition such as request headers.
Example
This example shows using the plugin to cache response with default options.
const fastify = require('fastify')
const fastifyResponseCaching = require('fastify-response-caching')
fastify.register(fastifyResponseCaching)
This example shows using the plugin to cache response with customized caching time.
const fastify = require('fastify')
const fastifyResponseCaching = require('fastify-response-caching')
fastify.register(fastifyResponseCaching, {ttl: 5000})
This example shows using the plugin to cache response with customized caching conditions.
const fastify = require('fastify')
const fastifyResponseCaching = require('fastify-response-caching')
fastify.register(fastifyResponseCaching, {ttl: 5000, headers: ['x-request-agent']})
API
Options
*fastify-response-caching* accepts the options object:
{
ttl:
additionalCondition: {
headers: >
}
}
ttl(Default:1000): a value, in milliseconds, for the lifetime of the response cache.additionalCondition(Default:undefined): a configuration of additional condition for caching.additionalCondition.headers(Default:[]): a list of string, headers that you want to include in the caching condition.
License
[MIT License](LICENSE)
Related Skills
Awesome Go
A curated list of awesome Go frameworks, libraries and software
Development next.js
| The React Framework | 138360 | 1503 | 1 |
Development sharing-skills
skill for guidance.
Development root-cause-tracing
Use when errors occur deep in execution and you need to trace back to find the original trigger.
Development Template Skill
Minimal skeleton for a new skill project structure.
Development Third-party Notices
THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THI
Development