Comparing version 3.0.4 to 4.0.0
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 @@ |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2
3133
11
22