Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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 1.0.0 to 1.0.1

10

index.js

@@ -0,4 +1,12 @@

var deprecate = require('depd')('nocache')
module.exports = function nocache (options) {
var noEtag = (options || {}).noEtag
options = options || {}
if (options.hasOwnProperty('noEtag')) {
deprecate('noEtag will be removed in the next version of nocache. Please remove this option.')
}
var noEtag = options.noEtag
return function nocache (req, res, next) {

@@ -5,0 +13,0 @@ res.setHeader('Surrogate-Control', 'no-store')

8

package.json

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

"description": "Middleware to destroy caching",
"version": "1.0.0",
"version": "1.0.1",
"license": "MIT",

@@ -26,3 +26,4 @@ "keywords": [

"scripts": {
"test": "standard && mocha"
"pretest": "standard",
"test": "mocha"
},

@@ -40,3 +41,6 @@ "devDependencies": {

]
},
"dependencies": {
"depd": "1.1.0"
}
}

@@ -6,2 +6,4 @@ Middleware to turn off caching

[_Looking for a changelog?_](https://github.com/helmetjs/helmet/blob/master/HISTORY.md)
It's possible that you've got bugs in an old HTML or JavaScript file, and with a cache, some users will be stuck with those old versions. This will (try to) abolish all client-side caching.

@@ -21,8 +23,2 @@

If you want to crush the `ETag` header as well, you can:
```javascript
app.use(nocache({ noEtag: true }))
```
Caching has some real benefits, and you lose many of them here. Browsers won't cache resources with this enabled, although *some* performance is retained if you keep ETag support. It's also possible that you'll introduce *new* bugs and you'll wish people had old resources cached, but that's less likely.
Caching has performance benefits, and you lose them here. It's also possible that you'll introduce *new* bugs and you'll wish people had old resources cached, but that's less likely.

Sorry, the diff of this file is not supported yet

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