File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/content/docs/images/examples Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,9 @@ export default {
1919 const watermarkKey = " my-watermark" ;
2020 const sourceKey = " my-source-image" ;
2121
22- let cache = await caches .open (" transformed-images" );
23- let cacheKey = watermarkKey + " /" + sourceKey ;
24- let cacheResponse = await cache .match (watermarkKey + " / " + sourceKey );
22+ const cache = await caches .open (" transformed-images" );
23+ const cacheKey = new URL ( sourceKey + " /" + watermarkKey , request . url ) ;
24+ const cacheResponse = await cache .match (cacheKey );
2525
2626 if (cacheResponse ) {
2727 return cacheResponse ;
@@ -40,7 +40,7 @@ export default {
4040
4141 const response = result .response ();
4242
43- ctx .waitUntil (cache .put (cacheKey , response ));
43+ ctx .waitUntil (cache .put (cacheKey , response . clone () ));
4444
4545 return result .response ();
4646 },
You can’t perform that action at this time.
0 commit comments