
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
fastify-disablecache
Advanced tools
Fastify plugin to disable client-side caching
Inspired by nocache, the fastify-disablecache plugin sets the following response headers and values to disable client-side caching:
Cache-Control: no-store, max-age=0, must-revalidate
Expires: 0
Pragma: no-cache
Surrogate-Control: no-store
This plugin was created out of a need for an easy way to disable client-side caching for data received from backend APIs. This ensures data is always current when called by applications.
Cache-Control - Primary response header for configuring cache controls since HTTP/1.1; whilst no-store is the directive to disable caching, clients such as Internet Explorer did not use it, thus the addition of max-age=0, must-revalidateExpires - Included for backwards compatibility with HTTP/1.0 cachesPragma - Included for backwards compatibility with HTTP/1.0 caches, was used by Internet ExplorerSurrogate-Control - Not a standardised response header but is used by CDNs and reverse proxies for cache controlInstall using npm:
npm i fastify-disablecache
For Fastify v3.x support, use fastify-disablecache@2.0.8.
const Fastify = require("fastify");
const disableCache = require("fastify-disablecache");
const server = Fastify();
server.register(disableCache);
server.get("/", (_req, res) => {
res.send("ok");
});
server.listen(3000, (err) => {
if (err) throw err;
console.log("Server listening on 3000");
});
Contributions are welcome, and any help is greatly appreciated!
See the contributing guide for details on how to get started. Please adhere to this project's Code of Conduct when contributing.
fastify-disablecache is licensed under the MIT license.
FAQs
Fastify plugin to disable client-side caching
The npm package fastify-disablecache receives a total of 6,372 weekly downloads. As such, fastify-disablecache popularity was classified as popular.
We found that fastify-disablecache demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.