漸進式web應用程序_漸進式Web應用程序與加速的移動頁面:有什么區別,哪種最適合您?

漸進式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應用程序

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/391016.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/391016.shtml
英文地址,請注明出處:http://en.pswp.cn/news/391016.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

高光譜圖像分類_高光譜圖像分析-分類

高光譜圖像分類初學者指南 (Beginner’s Guide) This article provides detailed implementation of different classification algorithms on Hyperspectral Images(HSI).本文提供了在高光譜圖像(HSI)上不同分類算法的詳細實現。 目錄 (Table of Contents) Introduction to H…

在Java里如何給一個日期增加一天

在Java里如何給一個日期增加一天 我正在使用如下格式的日期: yyyy-mm-dd. 我怎么樣可以給一個日期增加一天? 回答一 這樣應該可以解決問題 String dt "2008-01-01"; // Start date SimpleDateFormat sdf new SimpleDateFormat("yyyy-MM-dd&q…

CentOS 7安裝和部署Docker

版權聲明:本文為博主原創文章,未經博主允許不得轉載。 https://blog.csdn.net/u010046908/article/details/79553227 Docker 要求 CentOS 系統的內核版本高于 3.10 ,查看本頁面的前提條件來驗證你的CentOS 版本是否支持 Docker 。通過 uname …

JavaScript字符串方法終極指南-拆分

The split() method separates an original string into an array of substrings, based on a separator string that you pass as input. The original string is not altered by split().split()方法根據您作為輸入傳遞的separator字符串,將原始字符串分成子字符串…

機器人的動力學和動力學聯系_通過機器學習了解幸福動力學(第2部分)

機器人的動力學和動力學聯系Happiness is something we all aspire to, yet its key factors are still unclear.幸福是我們所有人都渴望的東西,但其關鍵因素仍不清楚。 Some would argue that wealth is the most important condition as it determines one’s li…

在Java里怎將字節數轉換為我們可以讀懂的格式?

問題:在Java里怎將字節數轉換為我們可以讀懂的格式? 在Java里怎將字節數轉換為我們可以讀懂的格式 像1024應該變成"1 Kb",而1024*1024應該變成"1 Mb". 我很討厭為每個項目都寫一個工具方法。在Apache Commons有沒有這…

ubuntu 16.04 安裝mysql

2019獨角獸企業重金招聘Python工程師標準>>> 1) 安裝 sudo apt-get install mysql-server apt-get isntall mysql-client apt-get install libmysqlclient-dev 2) 驗證 sudo netstat -tap | grep mysql 如果有 就代表已經安裝成功。 3)開啟遠程訪問 1、 …

shell:多個文件按行合并

paste file1 file2 file3 > file4 file1內容為: 1 2 3 file2內容為: a b c file3內容為: read write add file4內容為: 1 a read 2 b write 3 c add 轉載于:https://www.cnblogs.com/seaBiscuit0922/p/7728444.html

form子句語法錯誤_用示例語法解釋SQL的子句

form子句語法錯誤HAVING gives the DBA or SQL-using programmer a way to filter the data aggregated by the GROUP BY clause so that the user gets a limited set of records to view.HAVING為DBA或使用SQL的程序員提供了一種過濾由GROUP BY子句聚合的數據的方法&#xff…

leetcode 1310. 子數組異或查詢(位運算)

有一個正整數數組 arr,現給你一個對應的查詢數組 queries,其中 queries[i] [Li, Ri]。 對于每個查詢 i,請你計算從 Li 到 Ri 的 XOR 值(即 arr[Li] xor arr[Li1] xor … xor arr[Ri])作為本次查詢的結果。 并返回一…

大樣品隨機雙盲測試_訓練和測試樣品生成

大樣品隨機雙盲測試This post aims to explore a step-by-step approach to create a K-Nearest Neighbors Algorithm without the help of any third-party library. In practice, this Algorithm should be useful enough for us to classify our data whenever we have alre…

vue組件命名指南,不為取名而糾結

前言 自古中國取名文化博大進深,往往取一個好的名字而絞盡腦汁.那么一個好名字能夠帶來什么呢? 名字的內涵必需和使用者固有的本性相配套不和名人重名、不易重名、創意新穎,真正體現通過名字以區分人的作用響亮上口讀起來流暢好聽,協音美好,…

JavaScript 基礎,登錄驗證

<script></script>的三種用法&#xff1a;放在<body>中放在<head>中放在外部JS文件中三種輸出數據的方式&#xff1a;使用 document.write() 方法將內容寫到 HTML 文檔中。使用 window.alert() 彈出警告框。使用 innerHTML 寫入到 HTML 元素。使用 &qu…

使用final類的作用是什么?

問題&#xff1a;使用final類的作用是什么&#xff1f; 我在看一本關于Java的書&#xff0c;它里面說你可以定義一個類為final。我搞不明白有什么地方會被用到這樣。 我是一個編程萌新。我想知道程序員在他們的程序里面都是怎么用fianl類的。如果知道他們是什么時候使用的話&…

photoshop cc_如何使用Photoshop CC將圖片變成卡通

photoshop ccA fun photo effect is to make a photo look like a cartoon. In this tutorial you will learn how to use Photoshop CC to make a photo look like a cartoon drawing.有趣的照片效果是使照片看起來像卡通漫畫。 在本教程中&#xff0c;您將學習如何使用Photos…

從數據角度探索在新加坡的非法毒品

All things are poisons, for there is nothing without poisonous qualities. It is only the dose which makes a thing poison.” ― Paracelsus萬物都是毒藥&#xff0c;因為沒有毒藥就沒有什么。 只是使事物中毒的劑量。” ― 寄生蟲 執行摘要(又名TL&#xff1b; DR) (Ex…

Android 自定義View實現QQ運動積分抽獎轉盤

因為偶爾關注QQ運動&#xff0c; 看到QQ運動的積分抽獎界面比較有意思&#xff0c;所以就嘗試用自定義View實現了下&#xff0c;原本想通過開發者選項查看下界面的一些信息&#xff0c;后來發現積分抽獎界面是在WebView中展示的&#xff0c;應該是在H5頁面中用js代碼實現的&…

瑞立視:厚積薄發且具有“工匠精神”的中國品牌

一家成立兩年的公司&#xff1a;是如何在VR行業趨于穩定的情況下首次融資就獲得如此大額的金額呢&#xff1f; 2017年VR行業內宣布融資的公司寥寥無幾&#xff0c;無論是投資人還是消費者對這個 “寵兒”都開始紛紛投以懷疑的目光。但就在2017年7月27日&#xff0c;深圳市一家…

蘋果系統使用svg 動畫_為什么要使用SVG圖像:如何為SVG設置動畫并使其快速閃電化

蘋果系統使用svg 動畫我們為什么要使用SVG&#xff1f; (Why Are We Using SVG?) The web development sector is growing at a rapid pace, and SVG (scalable vector graphics) images are becoming more popular. As vector images, SVGs are composed of mathematical equ…

CSV模塊的使用

CSV模塊的使用 1、csv簡介 CSV (Comma Separated Values)&#xff0c;即逗號分隔值&#xff08;也稱字符分隔值&#xff0c;因為分隔符可以不是逗號&#xff09;&#xff0c;是一種常用的文本 格式&#xff0c;用以存儲表格數據&#xff0c;包括數字或者字符。很多程序在處理數…