@@ -242,16 +242,18 @@ module.exports = merge(commonConfig, {
242242 staticFileGlobsIgnorePatterns : [ / \. m a p $ / , / a s s e t - m a n i f e s t \. j s o n $ / ] ,
243243 maximumFileSizeToCacheInBytes : 1024 * 1024 * 20 , // 20mb
244244 runtimeCaching : [
245- {
246- urlPattern : / a p i \/ v 1 \/ / ,
247- handler : 'networkFirst' ,
248- options : {
249- cache : {
250- maxEntries : 50 ,
251- name : 'sandboxes-cache' ,
252- } ,
253- } ,
254- } ,
245+ // Don't do this, because it will cache API responses to the server. Even if no-cache headers
246+ // are set.
247+ // {
248+ // urlPattern: /api\/v1\//,
249+ // handler: 'networkFirst',
250+ // options: {
251+ // cache: {
252+ // maxEntries: 50,
253+ // name: 'sandboxes-cache',
254+ // },
255+ // },
256+ // },
255257 {
256258 urlPattern : / a p i \/ v 1 \/ d e p e n d e n c i e s / ,
257259 handler : 'fastest' ,
@@ -296,6 +298,18 @@ module.exports = merge(commonConfig, {
296298 } ,
297299 } ,
298300 } ,
301+ // We resolve `package.json` to resolve versions (e.g. next -> 15.0.5). We need to have a much shorter cache on this
302+ {
303+ urlPattern : / ^ h t t p s : \/ \/ u n p k g \. c o m \/ .* \/ p a c k a g e .j s o n / ,
304+ handler : 'networkFirst' ,
305+ options : {
306+ cache : {
307+ maxEntries : 300 ,
308+ name : 'unpkg-dep-pkg-cache' ,
309+ maxAgeSeconds : 60 * 5 , // 5 minutes
310+ } ,
311+ } ,
312+ } ,
299313 {
300314 urlPattern : / ^ h t t p s : \/ \/ u n p k g \. c o m / ,
301315 handler : 'cacheFirst' ,
0 commit comments