--no-cache option
This commit is contained in:
@ -46,7 +46,8 @@ localWebServer({
|
|||||||
mime: options.cli.server.mime,
|
mime: options.cli.server.mime,
|
||||||
blacklist: options.cli.server.blacklist.map(regexp => RegExp(regexp, "i")),
|
blacklist: options.cli.server.blacklist.map(regexp => RegExp(regexp, "i")),
|
||||||
proxyRoutes: options.cli.server.proxyRoutes,
|
proxyRoutes: options.cli.server.proxyRoutes,
|
||||||
spa: options.cli.server.spa
|
spa: options.cli.server.spa,
|
||||||
|
'no-cache': options.cli.server['no-cache']
|
||||||
}).listen(options.cli.server.port, onServerUp)
|
}).listen(options.cli.server.port, onServerUp)
|
||||||
|
|
||||||
function halt (message) {
|
function halt (message) {
|
||||||
|
@ -17,6 +17,10 @@ module.exports = {
|
|||||||
description: 'Enable gzip compression, reduces bandwidth.', group: 'server'
|
description: 'Enable gzip compression, reduces bandwidth.', group: 'server'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
name: 'no-cache', alias: 'n', type: Boolean,
|
||||||
|
description: 'Disable etag-based caching.', group: 'server'
|
||||||
|
},
|
||||||
|
{
|
||||||
name: 'help', alias: 'h', type: Boolean,
|
name: 'help', alias: 'h', type: Boolean,
|
||||||
description: 'Print these usage instructions', group: 'misc'
|
description: 'Print these usage instructions', group: 'misc'
|
||||||
},
|
},
|
||||||
|
@ -83,8 +83,11 @@ function getApp (options) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
app.use(conditional())
|
/* Cache */
|
||||||
app.use(etag())
|
if (!options['no-cache']) {
|
||||||
|
app.use(conditional())
|
||||||
|
app.use(etag())
|
||||||
|
}
|
||||||
|
|
||||||
/* mime-type overrides */
|
/* mime-type overrides */
|
||||||
if (options.mime) {
|
if (options.mime) {
|
||||||
|
Reference in New Issue
Block a user