@@ -128,16 +128,32 @@ module.exports = merge(commonConfig, {
128128 } ,
129129 minify : true ,
130130 // For unknown URLs, fallback to the index page
131- navigateFallback : 'https://new.codesandbox.io/frame.html' ,
132- staticFileGlobs : [ 'www/frame.html' ] ,
133- stripPrefix : 'www/' ,
131+ staticFileGlobs : [ ] , // don't pre-cache anything
134132 // Ignores URLs starting from /__ (useful for Firebase):
135133 // https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219
136- navigateFallbackWhitelist : [ / ^ (? ! \/ _ _ ) .* / ] ,
137134 // Don't precache sourcemaps (they're large) and build asset manifest:
138- staticFileGlobsIgnorePatterns : [ / \. m a p $ / , / a s s e t - m a n i f e s t \. j s o n $ / ] ,
139135 maximumFileSizeToCacheInBytes : 5242880 ,
136+ directoryIndex : false ,
137+ verbose : true ,
140138 runtimeCaching : [
139+ {
140+ urlPattern : / ^ h t t p s : \/ \/ \w + \. c o d e s a n d b o x \. \w + \/ $ / , // request to /
141+ handler : 'networkFirst' ,
142+ options : {
143+ debug : true ,
144+ } ,
145+ } ,
146+ {
147+ urlPattern : / \. w o r k e r \. j s $ / ,
148+ handler : 'cacheFirst' ,
149+ options : {
150+ cache : {
151+ maxEntries : 50 ,
152+ name : 'workers-cache' ,
153+ } ,
154+ debug : true ,
155+ } ,
156+ } ,
141157 {
142158 urlPattern : / a p i \/ v 1 \/ s a n d b o x e s / ,
143159 handler : 'networkFirst' ,
@@ -146,6 +162,7 @@ module.exports = merge(commonConfig, {
146162 maxEntries : 50 ,
147163 name : 'sandboxes-cache' ,
148164 } ,
165+ debug : true ,
149166 } ,
150167 } ,
151168 {
@@ -156,19 +173,21 @@ module.exports = merge(commonConfig, {
156173 maxAgeSeconds : 60 * 60 * 24 ,
157174 name : 'dependency-version-cache' ,
158175 } ,
176+ debug : true ,
159177 } ,
160178 } ,
161179 {
162180 // These should be dynamic, since it's not loaded from this domain
163181 // But from the root domain
164- urlPattern : / c o d e s a n d b o x \. i o \ /s t a t i c \/ j s \/ / ,
182+ urlPattern : / c o d e s a n d b o x \. \w + \ /s t a t i c \/ ( j s | b r o w s e r f s ) \/ / ,
165183 handler : 'fastest' ,
166184 options : {
167185 cache : {
168186 // A day
169187 maxAgeSeconds : 60 * 60 * 24 ,
170188 name : 'static-root-cache' ,
171189 } ,
190+ debug : true ,
172191 } ,
173192 } ,
174193 {
@@ -180,6 +199,7 @@ module.exports = merge(commonConfig, {
180199 maxAgeSeconds : 60 * 60 * 24 * 7 ,
181200 name : 'dependency-url-generator-cache' ,
182201 } ,
202+ debug : true ,
183203 } ,
184204 } ,
185205 {
@@ -190,6 +210,7 @@ module.exports = merge(commonConfig, {
190210 maxAgeSeconds : 60 * 60 * 24 * 7 ,
191211 name : 'dependency-files-cache' ,
192212 } ,
213+ debug : true ,
193214 } ,
194215 } ,
195216 {
@@ -201,6 +222,7 @@ module.exports = merge(commonConfig, {
201222 name : 'unpkg-dep-cache' ,
202223 maxAgeSeconds : 60 * 60 * 24 * 7 ,
203224 } ,
225+ debug : true ,
204226 } ,
205227 } ,
206228 {
@@ -212,6 +234,7 @@ module.exports = merge(commonConfig, {
212234 name : 'jsdelivr-dep-cache' ,
213235 maxAgeSeconds : 60 * 60 * 24 * 7 ,
214236 } ,
237+ debug : true ,
215238 } ,
216239 } ,
217240 {
@@ -223,6 +246,7 @@ module.exports = merge(commonConfig, {
223246 name : 'cloudflare-cache' ,
224247 maxAgeSeconds : 60 * 60 * 24 * 7 ,
225248 } ,
249+ debug : true ,
226250 } ,
227251 } ,
228252 ] ,
0 commit comments