When need to develop Progressive Web App (PWA)?

旧街凉风 提交于 2020-03-05 01:38:46

问题


I'm developing an Angular 7 app for windows users, and I want to know:

  • Does PWA always improve performance?
  • Does it target only specific platforms?

回答1:


Here is the answer to both of your questions regarding Progressive Web Applications (PWA):

1) Does it always improve performance?

Yes, and it is all thanks to the usage of Service Workers. Do note that to enjoy the benefits of PWAs and service workers, it must be served via HTTPS.

As stated on the introduction page to PWAs,

A service worker, written in JavaScript, is like a client-side proxy and puts you in control of the cache and how to respond to resource requests. By pre-caching key resources you can eliminate the dependence on the network, ensuring an instant and reliable experience for your users.

2) Is it only used for specific platforms?

PWAs are available on all platforms - Browsers, Mobile devices, and even desktops. However, do take note that certain PWA features may not be universally supported across browsers/operating systems.




回答2:


There are different caching strategies you can apply to static assets and also API Responses.

This brings you not only the possibility to deliver content even when your users are offline, but also to improve overall performances as you are going to save some Network Requests by providing cached Responses.

If you are interested in learning more about PWAs, I wrote some articles about them:

  • Intro from zero and comparison with native apps
  • Angular PWA step by step Demo. In this post I also describe the two caching strategies offered by Angular (freshness and performance) and show how can you implement them.


来源:https://stackoverflow.com/questions/57157629/when-need-to-develop-progressive-web-app-pwa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!