We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ebb9cdd commit 0535fd5Copy full SHA for 0535fd5
scripts/webpack.client.config.js
@@ -67,7 +67,36 @@ module.exports = (options = {}) => merge(
67
]
68
}),
69
].concat(prod ? [
70
- new GenerateSW(),
+ new GenerateSW({
71
+ runtimeCaching: [{
72
+ urlPattern: "",
73
+ handler: 'StaleWhileRevalidate',
74
+ options: {
75
+ cacheName: 'code-server',
76
+ expiration: {
77
+ maxAgeSeconds: 86400,
78
+ },
79
+ cacheableResponse: {
80
+ statuses: [0, 200],
81
82
83
+ }
84
+ // Network first caching is also possible.
85
+ /*{
86
87
+ handler: 'NetworkFirst',
88
89
+ networkTimeoutSeconds: 4,
90
91
92
93
94
95
96
97
98
+ }*/]
99
+ }),
100
] : [
101
new webpack.HotModuleReplacementPlugin(),
102
]),
0 commit comments