Skip to content

Commit 7c72425

Browse files
committed
prevent caching by means of cache-control. fixes #27
1 parent a9d7910 commit 7c72425

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

index.js

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function runner (opts) {
3636
if (opts.input === 'javascript') {
3737
if (/^\/bundle\.js/.test(req.url)) {
3838
res.setHeader('content-type', 'application/javascript');
39+
res.setHeader('cache-control', 'no-cache');
3940
bundle.createReadStream().pipe(res);
4041
return;
4142
}

static/index.html

+2-7
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<script src="/reporter.js"></script>
65
</head>
76
<body>
8-
<script>
9-
document.write(
10-
'<' + 'script src="/bundle.js?' + Math.random().toString(16).slice(2) +
11-
'"><' + '/script' + '>'
12-
)
13-
</script>
7+
<script src="/reporter.js"></script>
8+
<script src="/bundle.js"></script>
149
</body>
1510
</html>

0 commit comments

Comments
 (0)