• Stars
    star
    138
  • Rank 264,508 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Middleware to disable client-side caching

Middleware to turn off caching

This Express middleware sets some HTTP response headers to try to disable client-side caching.

To use it:

const nocache = require("nocache");

// ...

app.use(nocache());

This sets three headers, disabling a lot of browser caching:

  • Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate
  • Expires: 0
  • Surrogate-Control: no-store

You may wish to do this if you want to ensure that users have up-to-date resources, or if you want to clear out an old version for some reason.

More Repositories

1

helmet

Help secure Express apps with various HTTP headers
TypeScript
10,138
star
2

csp

The source for this module has moved to the Helmet repository.
223
star
3

hsts

The source for this module has moved to the Helmet repository.
86
star
4

frameguard

The source for this module has moved to the Helmet repository.
76
star
5

x-xss-protection

The source for this module has moved to the Helmet repository.
39
star
6

hide-powered-by

The source for this module has moved to the Helmet repository.
37
star
7

content-security-policy-builder

Build Content Security Policy directives
TypeScript
31
star
8

hpkp

Deprecated HTTP Public Key Pinning (HPKP) middleware
JavaScript
31
star
9

ienoopen

The source for this module has moved to the Helmet repository.
20
star
10

dont-sniff-mimetype

The source for this module has moved to the Helmet repository.
19
star
11

feature-policy

Middleware for setting the Feature-Policy HTTP response header
TypeScript
15
star
12

content-security-policy-parser

parse content security policy directives
TypeScript
12
star
13

helmetjs.github.io

Website for Helmet
SCSS
12
star
14

referrer-policy

The source for this module has moved to the Helmet repository.
12
star
15

crossdomain

The source for this module has moved to the Helmet repository.
11
star
16

dns-prefetch-control

The source for this module has moved to the Helmet repository.
10
star
17

clearsitedata

Middleware to set the Clear-Site-Data HTTP header
TypeScript
8
star
18

express-json-hijack-prevention

ABANDONED! Help prevent JSON hijacking in Express.
JavaScript
7
star
19

expect-ct

Express middleware to set the Expect-CT header
JavaScript
4
star
20

eslint-config-helmet

JavaScript
4
star
21

cross-origin-resource-policy

The source for this module has moved to the Helmet repository.
3
star