Progressive Web Application Development by Example
上QQ阅读APP看书,第一时间看更新

Should you polyfil response caching?

Request caching can also be polyfiled using IndexedDB. However, now that most browsers support service workers and caching, I don't think this approach has a wise use of resources. Outside of mobile use, Internet Explorer is the main browser without service worker support. At the time of writing this book, IE should really be used primarily in enterprises when their line of business applications have not been upgraded to modern standards.

This means a very small percentage of potential users that may open your PWA will do so in a browser without service worker support. When they do, it is pretty safe to say that they are most likely on a desktop of some sort with a reliable network connection.

Despite developing hundreds of applications using an early implementation of client-side asset caching, I have officially deprecated this approach from my recommendations.