渐进式web应用程序

Do you understand what PWAs and AMPs are, and which might be better for you? Let's have a look and find out.

您了解什么是PWA和AMP,哪一种可能更适合您? 让我们看看并找出答案。

So many people own smartphones these days. This opens up endless opportunities for a business - opportunities which, however, are immediately challenged by the immense number of competitors in the mobile software market.

这些天有很多人拥有智能手机。 这为企业开辟了无限的机会-但是,这些机会立即受到移动软件市场上众多竞争对手的挑战。

Mobile apps are surely more convenient than web or desktop platforms. Yet, they are not the most comfortable option that the industry offers.

移动应用肯定比Web或桌面平台更方便。 但是,它们并不是业界提供的最舒适的选择。

To hit the highest level of user satisfaction and to outrun competitors, inventive people opt in favor of progressive web apps (PWAs) or accelerated mobile pages (AMPs).

为了达到最高的用户满意度并超越竞争对手,富有创造力的人们选择了渐进式Web应用程序(PWA)或加速移动页面(AMP)。

What are these things, and how should you choose the best option? Let’s consider each one-by-one by going through these simple questions:

这些是什么东西,您应该如何选择最佳选择? 让我们通过以下简单的问题逐一考虑:

  1. What is a PWA?
    什么是PWA?
  2. What is an AMP?
    什么是AMP?
  3. How are they similar?
    它们有何相似之处?
  4. How are they different?
    它们有何不同?
  5. Why PWAs are better than web pages
    为什么PWA比网页更好
  6. Why PWAs are better than native mobile
    为什么PWA比本机移动更好
  7. Why AMPs are better than web pages
    为什么AMP比网页更好
  8. Why AMPs are NOT better than native mobile
    为什么AMP并不比本地移动电话好

1.什么是PWA? (1. What Is a PWA?)

A progressive web application, or PWA, unites the advantages of both web and mobile apps into a single software product. As Google declares, PWAs are “user experiences that have the reach of the web and are reliable, fast, and engaging”. It is a technology that lets you use a website as if it was a native app.

渐进式Web应用程序(即PWA)将Web和移动应用程序的优点结合到一个软件产品中。 正如Google所宣称的那样,PWA是“具有网络影响力,可靠,快速且引人入胜的用户体验”。 它是一项技术,可让您像使用本地应用程序一样使用网站。

Twitter is one of the major companies using PWAs. To install the app, you open the web version on your phone and add it to your home screen. When you open Twitter from the home screen icon, you will be opening it as a progressive web app.

Twitter是使用PWA的主要公司之一。 要安装该应用,请在手机上打开网络版本并将其添加到主屏幕。 从主屏幕图标打开Twitter时,您将其作为渐进式Web应用程序打开。

基本原理 (Fundamentals)

PWAs are a highly responsive and easily shareable solution, which can work offline. They store HTML and CSS files in the browser cache and archive them with service workers. This makes it possible to use the web page offline. Service workers are one of the three essential components of a PWA, along with the manifest file and a secure protocol HTTPS.

PWA是一种响应Swift且易于共享的解决方案,可以脱机工作。 他们将HTML和CSS文件存储在浏览器缓存中,并与服务工作者一起将其存档。 这样就可以离线使用网页。 服务人员以及清单文件和安全协议HTTPS是PWA的三个基本组件之一。

Service workers are JavaScript code components which play the role of a proxy between the network and the browser.

服务工作者是JavaScript代码组件,它们充当网络和浏览器之间的代理角色。

When you open a web page for the first time, service workers store the necessary data in the browser cache. When you open it for the second time, service workers retrieve this data from the cache even before the app checked network availability.

首次打开网页时,服务人员将必要的数据存储在浏览器缓存中。 当您第二次打开它时,服务人员甚至在应用检查网络可用性之前就从缓存中检索此数据。

Not only do they provide the ability to work offline but also they greatly boost the response time. Service workers also manage push notifications.

它们不仅提供脱机工作能力,而且还大大提高了响应时间。 服务人员还管理推送通知。

The manifest file is a JSON file containing all the information about your app. For instance, it contains data about the home screen icon of your PWA, its short name, color palette, or theme.

清单文件是一个JSON文件,其中包含有关您的应用程序的所有信息。 例如,它包含有关PWA的主屏幕图标,其短名称,调色板或主题的数据。

If you are using the Chrome browser on an Android phone, the manifest file will trigger the automatic installation of the PWA onto your phone.

如果您在Android手机上使用Chrome浏览器,则清单文件将触发将PWA自动安装到手机上。

The secure HTTPS protocol is an absolute must if you develop a progressive web app. While service workers make the very concept of a PWA possible, they are vulnerable to network errors or breaches. Service workers can intercept network requests and modify responses. To ensure data security and network security, the secure protocol needs to be used.

如果您开发渐进式Web应用程序,则绝对必须使用安全的HTTPS协议 。 尽管服务人员使PWA的概念成为可能,但他们容易受到网络错误或破坏的影响。 服务人员可以拦截网络请求并修改响应。 为了确保数据安全和网络安全,需要使用安全协议。

成功的故事 (Success stories)

Twitter is not the only company that has benefited from PWAs. Check out these case studies published by Google to see how this technology helped popular businesses succeed. Among these companies are Pinterest, Alibaba, The Weather Channel, Lancome, and The Home Depot.

Twitter不是唯一从PWA中受益的公司。 查看由Google发布的这些案例研究 ,以了解这项技术如何帮助热门企业取得成功。 在这些公司中,有Pinterest , 阿里巴巴 , 天气频道 , 兰蔻和家得宝。

2.什么是AMP? (2. What Is an AMP?)

AMP stands for accelerated mobile page. It's a mobile-friendly web page, which is designed to be loaded instantly. It is a fast and smoothly loading solution which is developed with the user experience in mind. Introduced as an open-source project, the AMP technology was integrated by Google in February 2016.

AMP代表加速的移动页面。 这是一个适合移动设备的网页,旨在立即加载。 这是一个快速且流畅的加载解决方案,它是根据用户体验开发的。 AMP技术作为一个开源项目引入,于2016年2月由Google集成。

In 2016, The Guardian announced that their platform was now available as an AMP. To help readers see how it worked, they displayed the same article both as a web version and an AMP version.

2016年, 《卫报》宣布他们的平台现已可作为AMP使用。 为了帮助读者了解它是如何工作的,他们展示了与Web版本和AMP版本相同的文章。

There were some differences, but they were insignificant. But what you'd notice right away was how much faster the AMP article loaded compared to the regular web article.

虽然存在一些差异,但是它们并不重要。 但是,您会立即注意到,与常规Web文章相比,AMP文章的加载速度更快。

基本原理 (Fundamentals)

The idea of AMPs is to reduce the amount of unnecessary content and functionality so that the app displays essential content immediately. The data can be reduced up to ten times. The three essential components of AMPs are AMP HTML, AMP Components, and the AMP Cache.

AMP的想法是减少不必要的内容和功能,以便该应用程序立即显示基本内容。 数据最多可减少十倍。 AMP的三个基本组件是AMP HTML,AMP组件和AMP缓存。

AMP HTML is a simplified version of regular HTML. AMP HTML does not allow some tags and elements of HTML (for example, forms). To understand better what AMP HTML should look like, check out the required mark-up.

AMP HTML是常规HTML的简化版本。 AMP HTML不允许HTML的某些标签和元素(例如,表单)。 为了更好地了解AMP HTML的外观,请查看所需的标记 。

AMP Components are the scripts that enable you to do without JavaScript. The idea of AMP is to get rid of all JavaScript scripts as make pages load more slowly.

AMP组件是使您无需JavaScript即可执行的脚本。 AMP的想法是消除所有JavaScript脚本,因为这会使页面加载更加缓慢。

But this does not mean that your page should do without animations, modified layouts, analytics data, autocomplete suggestions, or ads. There is an extensive library of components that enable you to implement these and a lot of other features.

但这并不意味着您的页面应该没有动画,修改的布局,分析数据,自动完成建议或广告。 有大量的组件库 ,使您能够实现这些功能以及许多其他功能。

The AMP Cache is a proxy-based content delivery network which fetches and caches page content. AMP Cache enables you as an app owner to easily introduce page updates. It optimizes and, if needed, modifies the AMP.

AMP缓存是基于代理的内容交付网络,可获取和缓存页面内容。 AMP Cache使您作为应用程序所有者可以轻松介绍页面更新。 它优化并在需要时修改AMP。

成功的故事 (Success stories)

The same as with PWAs, companies are often very proud of the business advantages that AMPs offer. Here is a collection of success stories and case studies of companies that used AMPs and benefited from them. Musement, RCS MediaGroup, CNBC, The Washington Post are all companies that have implemented or plan to implement AMPs.

与PWA一样,公司通常对AMP提供的业务优势感到非常自豪。 这里是使用AMP并从中受益的公司的成功案例和案例研究的集合。 MusementRCS MediaGroupCNBC《华盛顿邮报》都是已经实施或计划实施AMP的公司。

3. PWA和AMP有何相似之处? (3. How Are PWAs and AMPs similar?)

Both PWAs and AMPs are methods of displaying web pages on mobile devices. Both of them are created to enhance the user experience.

PWA和AMP都是在移动设备上显示网页的方法。 两者都是为了增强用户体验而创建的。

AMPs and PWAs both help reduce page load time. While AMPs may be slightly more effective in terms of loading speed than PWAs, the difference between AMP and PWA loading times is barely noticeable.

AMP和PWA都有助于减少页面加载时间。 虽然AMP在加载速度方面可能比PWA稍微有效,但是AMP与PWA加载时间之间的差异几乎没有引起注意。

Both technologies are actively supported by Google. There is a PWA page on Google Developers and an AMP page on Google Developers as well.

谷歌积极支持这两种技术。 Google Developers上有一个PWA页面,Google Developers上也有一个AMP页面 。

There are not a lot of other similarities, but this primary similarity is essential.

其他相似之处并不多,但是主要相似之处至关重要。

Now let’s see what the differences are.

现在,让我们看看有什么区别。

4. PWA和AMP有何不同? (4. How Are PWAs and AMPs Different?)

出现 (Appearance)

By using a PWA you do not feel like you are using a web page. PWAs look and feel like a mobile app.

通过使用PWA,您不会觉得自己在使用网页。 PWA的外观和感觉就像一个移动应用程序。

By using AMPs, you are well aware that you are using a web page because it looks the same.

通过使用AMP,您会清楚地知道您正在使用网页,因为它看起来是一样的。

发展历程 (Development)

In the case of PWAs, the application code is written either from scratch or with some parts of the existing code.

对于PWA,应用程序代码是从头开始编写的,或者是与现有代码的某些部分一起编写的。

In the case of AMPs, the existing code of a web page is stripped of unnecessary CSS and JS so that the web page loads faster.

在使用AMP的情况下,去除了网页现有代码中不必要CSS和JS,从而使网页加载速度更快。

用户体验 (User experience)

PWAs offer a much better user experience. They have push-notifications, a home screen icon, and no browser tabs. Also, they are much easier to download and lighter in size than a regular mobile app. PWAs load faster than a regular web version because they are embedded with App Shell. And PWAs can be used when the network connection is down.

PWA提供了更好的用户体验。 它们具有推送通知,主屏幕图标,并且没有浏览器选项卡。 而且,与常规移动应用程序相比,它们更容易下载且大小更轻。 由于PWA嵌入在App Shell中,因此其加载速度比常规Web版本要快。 当网络连接断开时,可以使用PWA。

AMPs offer a slightly improved user experience since the page loads faster than a regular page. Still, this is the only UX advantage that they offer. Unlike PWAs, AMPs cannot work offline.

由于页面加载速度比常规页面快,因此AMP可以提供稍微改善的用户体验。 尽管如此,这是它们提供的唯一UX优势。 与PWA不同,AMP无法离线工作。

性能 (Performance)

From an SEO standpoint, AMP wins the competition. Google favors these pages and lists them in the carousel of top stories, which can increase your click-through rate.

从SEO的角度来看,AMP赢得了竞争。 Google偏爱这些页面,并将它们列出在热门话题的轮播中,这可以提高您的点击率。

PWAs, in turn, do not have a direct advantage for SEO. However, better user experience translates into higher retention rates, which helps you win with SEO.

反过来,PWA对于SEO没有直接优势。 但是,更好的用户体验可以提高保留率,从而帮助您赢得SEO。

翻译自: https://www.freecodecamp.org/news/pwa-vs-amp-what-is-the-difference-and-how-do-you-choose/

渐进式web应用程序

渐进式web应用程序_渐进式Web应用程序与加速的移动页面:有什么区别,哪种最适合您?相关推荐

  1. Java web小项目_个人主页(2)—— 边缘加速原理与实现

    摘自:Java web小项目_个人主页(2)-- 边缘加速原理与实现 作者:丶PURSUING 发布时间: 2021-03-27 14:44:40 网址:https://blog.csdn.net/w ...

  2. 渐进式web应用程序_渐进式Web应用程序简介

    渐进式web应用程序 Interested in learning JavaScript? Get my ebook at jshandbook.com 有兴趣学习JavaScript吗? 在jsha ...

  3. 渐进式web应用程序_渐进式Web应用程序终极指南

    渐进式web应用程序 Progressive Web Apps, aka PWAs, are the best way for developers to make their webapps loa ...

  4. 渐进式web应用程序_渐进式Web应用程序:简介

    如果您从事网站建设业务,那么您可能会越来越多地听到人们谈论渐进式Web应用程序 (PWA). 由Google开发的PWA在吸引用户方面具有网络的所有优势,以及用户可以从本地应用程序获得的速度和可靠性. ...

  5. python怎么做软件程序_看 Python 超级程序员使用什么开发工具

    Python超级程序员使用的开发工具 我以个人的身份采访了几个顶尖的Python程序员,问了他们以下5个简单的问题: 当前你的主要开发任务是什么? 你在项目中使用的电脑是怎样的? 你使用什么IDE开发 ...

  6. 大小端交换的程序_数据库在小程序云开发中的应用

    " 高效率数据库为小程序·云开发赋能,共同为客户提供更多优质解决方案. " 目录 小程序·云开发介绍小程序·云开发的数据库服务解决方案及客户成功案例 小程序云开发介绍 " ...

  7. wxml 判断 小程序_如何判断小程序外包公司是否靠谱

    微信小程序依附微信App,由于其无需下载,无需安装,无需注册,直接用微信授权登录,不占内存等优势在短短2年多的时间斩获超过10亿用户.又因为微信官方开通了小程序附近五公里展示以及在微信搜一搜增加&qu ...

  8. 模型预测控制c语言程序_搭建第一个程序控制电路LED灯,体会C语言的魅力

    学习C语言,先从读程序开始!这一点是过来人的经验之谈.本文建议大家选择一款图形编程软件,本文选择了Mixly. 一.首先,介绍一下arduino UNO控制器内部电压的问题. v 高电平(5V):对应 ...

  9. pat上写java程序_如何运行Java程序和设置CLASSPAT

    导读: 如何运行JAVA和CLASSPATH环境变量的设置是学习和使用JAVA中最基本的问题,本不应在此赘述.但近来不少人在论坛上提出的问题却与此有关,我平时碰到的一些初学者也往往在这个问题上卡了壳, ...

最新文章

  1. oracle中lock的解释
  2. js简单的下拉选中效果
  3. 学术墙报模板_【学院动态】水产学院2020年研究生学术年会科研墙报评比活动开始...
  4. Qt 多线程TCP服务端一键关闭所有客户端
  5. 基于 MySQL Binlog 的 Elasticsearch 数据同步实践
  6. python基础(part15)--迭代
  7. python怎么发送微信给自己_Python新手教程:Python微信定时自动给【女朋友】发送天气预报...
  8. Python概率编程库PyMC应用案例二则
  9. Velocity中避免null引起的数据问题
  10. Python for Infomatics 第12章 网络编程四(译)
  11. 易编远航第七套大漠多线程多开入门高级篇
  12. EEGLAB 脑电数据处理与分析
  13. win7锁定该计算机快捷键,Win7电脑锁定计算机快捷键的方法.ppt
  14. 命运多舛。德体:多特蒙德队长罗伊斯因伤无缘卡塔尔世界杯
  15. 循环体中continue、break语句的使用
  16. Deep Learning × ECG (3) :心律失常ECG数据的预处理
  17. win10 cuda10.0 cudnn安装 卸载cuda9.0
  18. 读书笔记:Effective Java-第11章 并发Concurrency
  19. 汽车品牌、资讯、出行App获取安装来源统计
  20. PC端微信自带浏览器网页跳转授权页面空白问题

热门文章

  1. linux网络编程九:splice函数,高效的零拷贝
  2. Java面试题!java面向对象程序设计答案
  3. Java架构师必备框架技能核心笔记,工作感悟
  4. MMKV集成与原理,轻松拿下offer
  5. serial port 的操作
  6. django:bootstrap table加载django返回的数据
  7. mysql函数(二.数字函数)
  8. ecshop 前台个人中心修改侧边栏 和 侧边栏显示不全 或 导航现实不全
  9. C#学习笔记四: C#3.0自动属性匿名属性及扩展方法
  10. c#扫描图片去黑边(扫描仪去黑边)