Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overcoming the 50 MiB limitation on PWA cache for iOS

We are building a progressive web app for iOS devices and we know about the 50 MiB cache limitation imposed by the Safari web browser. How can we handle this limitation when we know that our app's service worker might have to cache data more than 50 MiB if we include all the static resources, videos and pictures etc. Our first preference is to keep the app running offline even after the cache is full and if that is not possible than at least prevent the app from breaking if the user is working offline.

It would be good if you give a generic answer which we can implement in other PWAs also.

like image 875
user444002 Avatar asked Apr 30 '18 04:04

user444002


People also ask

Are PWAs supported on iOS?

Every major browser and platform has support for service workers and are using the web manifest file in some form or fashion. This includes Apple's iPhones and iPads using iOS Safari. Do Progressive Web Apps (PWA) work on iOS? YES!!!

How big can a PWA be?

The group limit — this is defined as 20% of the global limit, but it has a minimum of 10 MB and a maximum of 2 GB. Each origin is part of a group (group of origins).


1 Answers

These days you can store much more than 50 MB on Safari mobile using IndexedDB: https://love2dev.com/blog/what-is-the-service-worker-cache-storage-limit/

If the size of free disk space is over 1 GB, the default limit is 500 MB; otherwise it is half the free disk space.

See for yourself using this tool: https://demo.agektmr.com/storage/

like image 124
Chris Avatar answered Sep 21 '22 07:09

Chris