nocache

WebJar for nocache

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

nocache
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

nocache
WebJar for nocache
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/helmetjs/nocache

Download nocache

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/nocache/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>nocache</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/nocache/
implementation 'org.webjars.npm:nocache:2.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/nocache/
implementation ("org.webjars.npm:nocache:2.1.0")
'org.webjars.npm:nocache:jar:2.1.0'
<dependency org="org.webjars.npm" name="nocache" rev="2.1.0">
  <artifact name="nocache" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='nocache', version='2.1.0')
)
libraryDependencies += "org.webjars.npm" % "nocache" % "2.1.0"
[org.webjars.npm/nocache "2.1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Middleware to turn off caching

Build Status

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 four headers, disabling a lot of browser caching:

  • Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate
  • Pragma: no-cache
  • 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.

org.webjars.npm

Helmet

Express.js security with HTTP headers

Versions

Version
2.1.0