cache-control config
This commit is contained in:
committed by
Lloyd Brookes
parent
aa11620b8e
commit
1c57d29b3f
@ -38,6 +38,7 @@ function localWebServer (options) {
|
||||
options = Object.assign({
|
||||
static: {},
|
||||
serveIndex: {},
|
||||
cacheControl: {},
|
||||
spa: null,
|
||||
log: {},
|
||||
compress: false,
|
||||
@ -116,6 +117,13 @@ function localWebServer (options) {
|
||||
middlewareStack.push(etag())
|
||||
}
|
||||
|
||||
/* cache-control headers */
|
||||
if (options.cacheControl) {
|
||||
const cacheControl = require('koa-cache-control')
|
||||
debug('Cache control', JSON.stringify(options.cacheControl))
|
||||
app.use(cacheControl(options.cacheControl))
|
||||
}
|
||||
|
||||
/* mime-type overrides */
|
||||
if (options.mime) {
|
||||
debug('mime override', JSON.stringify(options.mime))
|
||||
|
Reference in New Issue
Block a user