serve-static-x
v1.0.0
Published
Serve static files with cache busting capability (uses Express.static() aka serve-static)
Downloads
5
Maintainers
Readme
serve-static-x
Serve static files with cache busting capability; uses
Express.static()
aka serve-static
Use it just like serve-static except now you can set an additional option named "x" that enables a custom (secret) request header to be used to bypass receiving static files.
- Use in conjunction with
save-static
for caching and re-caching files to disk.
Install
$ npm install --save serve-static-x
Usage
var express = require('express');
var serveStaticX = require('serve-static-x');
var app = express();
var staticPath = path.join(__dirname, '/static/html'); // <= for example
// this is where the magic happens
app.use(serveStaticX(staticPath, {
x: 'x-my-secret-cache-busting-header'
}));
License
ISC © Buster Collings