Skip to content

Commit 92f40ca

Browse files
committed
Editor: Only cache GET requests.
1 parent c4b3e6e commit 92f40ca

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

editor/sw.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,13 @@ async function networkFirst( request ) {
273273

274274
}
275275

276-
const cache = await caches.open( cacheName );
277-
cache.put( request, response.clone() );
276+
if ( request.method === 'GET' ) {
277+
278+
const cache = await caches.open( cacheName );
279+
cache.put( request, response.clone() );
280+
281+
}
282+
278283
return response;
279284

280285
} catch {

0 commit comments

Comments
 (0)