While testing a progressive web app for one of our clients, I bumped into a suspicious error in the browser console: DOMException: Quota exceeded.
After browsing the app a few more times, it became clear the error would occur after a small number of images were added to the cache storage by the service worker. Looking in the Chrome DevTools Application tab, the cache storage was indeed over capacity.
How could this be? There were only ~15 images in the cache storage. Something was off.
Una Kravets implemented “Save For Offline” on her blog, using Service Workers. She described the reasoning, process, and code to implement.
With “Save For Offline”, if someone is reading your blog on the subway, and loses their Internet connection, they won’t lose their place. If they accidentally click and the browser refreshes, they won’t lose their place. If they want to save your article to read on an airplane or at at a café in a foreign country where they have no internet plan, they can do that. And if they just want to save battery and be on airplane mode, that’s cool too.
A new initiative called Fashion Like allows people to ‘like’ certain items of clothing on the company’s Facebook page, and these clicks are collated and displayed on the relevant clothes rack in real-time. Customers are thereby able to view the item’s online popularity in the real world to help them make their decision.