Most service worker code samples show only the happy path where the fetched resource will eventually be available, eg: self.addEventListener('fetch', event => { // Skip cross-origin requests, like those for Google Analytics. if (event.request.url.startsWith(self.location.origin)) { event.respondWith( caches.match(event.request).then(cachedResponse => { if (cachedResponse) { return cachedResponse; } return caches.open(RUNTIME).then(cache => { return fetch(event.request).then(response => { // Put … Continue reading Error handling for failed network requests with service workers
Tag: error handling
parchive: protecting backups against data corruption
As time goes by, my [place appropriate interval] backups may not grow much, but the size of my entire data archive exceeds the largest available hard disks (don't ask). Taking into account correctness guarantees by hard disk manufacturers, transmission errors over the network and who knows what else, I don't feel confident that I'll flip … Continue reading parchive: protecting backups against data corruption
The impact of network packet loss on HTTP latency
Over the course of my involvement [1] in my Indonesian company's website, the question of how to design a website to deal with slow and bad network links presented itself over several occasions as most of our users surf either over a mobile connection or a similarly dimensioned fixed line. While optimizing design and resources … Continue reading The impact of network packet loss on HTTP latency