|
|
6 years ago | |
|---|---|---|
| .. | ||
| dist | 6 years ago | |
| CHANGELOG.md | 6 years ago | |
| LICENSE | 6 years ago | |
| README.md | 6 years ago | |
| package.json | 6 years ago | |
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.
const nocache = require('nocache')
app.use(nocache())
This sets four headers, disabling a lot of browser caching:
Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidatePragma: no-cacheExpires: 0Surrogate-Control: no-storeCaching 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.