Socket
Socket
Sign inDemoInstall

nocache

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nocache - npm Package Compare versions

Comparing version 3.0.4 to 4.0.0

6

index.d.ts
import { IncomingMessage, ServerResponse } from "http";
declare const nocache: () => (
_req: IncomingMessage,
res: ServerResponse,
next: () => void
) => void;
declare const nocache: () => (_req: IncomingMessage, res: ServerResponse, next: () => void) => void;
export = nocache;
module.exports = function nocache() {
return function nocache(_, res, next) {
res.setHeader("Surrogate-Control", "no-store");
res.setHeader(
"Cache-Control",
"no-store, no-cache, must-revalidate, proxy-revalidate"
);
res.setHeader("Pragma", "no-cache");
res.setHeader("Cache-Control", "no-store, no-cache, must-revalidate, proxy-revalidate");
res.setHeader("Expires", "0");

@@ -10,0 +6,0 @@

10

package.json

@@ -8,3 +8,3 @@ {

"description": "Middleware to destroy caching",
"version": "3.0.4",
"version": "4.0.0",
"license": "MIT",

@@ -28,3 +28,3 @@ "keywords": [

"engines": {
"node": ">=12.0.0"
"node": ">=16.0.0"
},

@@ -42,7 +42,5 @@ "main": "index.js",

"devDependencies": {
"connect": "^3.7.0",
"eslint": "^8.16.0",
"prettier": "^2.6.2",
"supertest": "^6.2.3"
"eslint": "^8.41.0",
"prettier": "^2.8.8"
}
}

@@ -15,6 +15,5 @@ # Middleware to turn off caching

This sets four headers, disabling a lot of browser caching:
This sets three headers, disabling a lot of browser caching:
- `Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate`
- `Pragma: no-cache`
- `Expires: 0`

@@ -21,0 +20,0 @@ - `Surrogate-Control: no-store`

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc