Skip to content

Commit

Permalink
Disable cache when --cache flag is set to 0 (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabe authored and leo committed Jul 7, 2017
1 parent d90f267 commit 6d60755
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ module.exports = coroutine(function*(req, res, flags, current, ignoredFiles) {

if (flags.cache) {
streamOptions.maxAge = flags.cache
} else if (flags.cache === 0) {
// Disable the cache control by `send`, as there's no support for `no-cache`.
// Set header manually.
streamOptions.cacheControl = false
res.setHeader('Cache-Control', 'no-cache')
} else if (flags.single) {
// Cache assets of single page applications for a day.
// Later in the code, we'll define that `index.html` never
Expand Down

0 comments on commit 6d60755

Please sign in to comment.