[IO PWA] Great libraries and tools for great Progressive Web Apps

Source: Internet
Author: User

    • Sw-toolbox:github
      • It provides a cononical implementation of all the runtime caching strategies so you need for your dynamice content.
    • Sw-precache:github
      • It takes care of caching and maintaing all the resources in your app Shell
    • Sw-helpers:github
    • Lighthouse:github

    • https://developers.google.com/web/tools/service-worker-libraries/?hl=en
    • Application-shell
    • Code Lab

Sw-toolbox:

For the assets, you can use Cache-first:

Cachefirst, would go to cache for fetching data, if there was then return the cache back, would not go to network fo R fetching data.

If cannot get the data from the cache and then fallback to network to get data.

Toolbox.router. Get (    '/path/to/images/.*',    Toolbox.cachefirst,    {cache: {          'images',        6  //  cache at most 6 images     }})

For highly dynamic data, can use Network first: (Battle Lie-fi)

Networkfirst, would go network for fetching data, if get the data then return to back.

If cannot get the data, then fallback to cache.

Toolbox.router. Get (    '/posts/.*',    toolbox.networkfist,    {cache: {          'posts',        5           -  -     },
Networktimeoutseconds:3//After three sconds, fallback to cache
})

Fastest:

Race between Cache and network:

[IO PWA] Great libraries and tools for great Progressive Web Apps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.