forked from MapComplete/MapComplete
		
	Fix caching behaviour of service worker
This commit is contained in:
		
							parent
							
								
									a7b0db2416
								
							
						
					
					
						commit
						d50b60f07a
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -71,7 +71,7 @@ self.addEventListener('fetch',
 | 
				
			||||||
                event.respondWith(new Response(JSON.stringify({"service-worker-version": version})));
 | 
					                event.respondWith(new Response(JSON.stringify({"service-worker-version": version})));
 | 
				
			||||||
                return
 | 
					                return
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            const shouldBeCached = origin.host === requestUrl.host && origin.host !== "127.0.0.1:1234"  && origin.host !== "localhost" && !origin.host.endsWith(".gitpod.io")
 | 
					            const shouldBeCached = origin.host === requestUrl.host && origin.hostname !== "127.0.0.1"  && origin.hostname !== "localhost" && !origin.host.endsWith(".gitpod.io")
 | 
				
			||||||
            if (!shouldBeCached) {
 | 
					            if (!shouldBeCached) {
 | 
				
			||||||
                console.log("Not intercepting ", requestUrl.toString(), origin.host, requestUrl.host)
 | 
					                console.log("Not intercepting ", requestUrl.toString(), origin.host, requestUrl.host)
 | 
				
			||||||
                // We return _without_ calling event.respondWith, which signals the browser that it'll have to handle it himself
 | 
					                // We return _without_ calling event.respondWith, which signals the browser that it'll have to handle it himself
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue