# 渐进式 Web 应用

渐进式 Web 应用（progressive web app，PWA）是一种用 Web 应用清单构建、并且通常配有 Service Worker 的网站，因此它可以被安装到设备上，以类似应用的形态运行——具备离线运行、独立窗口、推送通知等特性——同时仍然可以通过其普通 URL 在任何浏览器中访问和使用。<sup>[1](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app)</sup> 这一术语由设计师弗朗西丝·贝里曼（Frances Berriman）与 [Google Chrome](https://www.edgepedia.org/zh/google-chrome) 工程师亚历克斯·拉塞尔（Alex Russell）于 2015 年提出，用来描述那些利用 Service Worker、Web 应用清单等新浏览器特性的应用，这些特性让 Web 应用成为操作系统上的一等公民。<sup>[2](https://prismatic-technologies.com/assets/images/erp.pdf)</sup>

| 关键事实 | 说明 |
|---|---|
| 核心要求 | 一份包含足够信息、可供浏览器安装该应用的 Web 应用清单；Service Worker 是可选的，但常用于提供离线支持<sup>[1](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app)</sup> |
| 术语起源 | 由弗朗西丝·贝里曼与亚历克斯·拉塞尔于 2015 年提出<sup>[2](https://prismatic-technologies.com/assets/images/erp.pdf)</sup> |
| Chromium 清单要求 | `name` 或 `short_name`、192 像素与 512 像素的图标、`start_url`、`display` 或 `display_override`，以及 `prefer_related_applications` 为 false 或缺失<sup>[3](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable)</sup> |
| 安装条件趋势 | Chrome 在移动端 108 版、桌面端 112 版中取消了 Service Worker 的 `fetch()` 处理函数要求；Safari 26 对可安装性没有任何要求<sup>[4](https://developer.chrome.com/blog/update-install-criteria?authuser=5)</sup><sup> • </sup><sup>[5](https://webkit.org/blog/17333/webkit-features-in-safari-26-0/)</sup> |
| iOS 里程碑 | iOS 与 iPadOS 16.4（2023 年）为主屏幕 Web 应用加入了 Web 推送、徽章 API 和清单 ID 支持<sup>[6](https://webkit.org/blog/13878/web-push-for-web-apps-on-ios-and-ipados/)</sup> |
| 体积示例 | 星巴克（Starbucks）点单 PWA 为 233 KB，比原来 148 MB 的 iOS 应用小 99.84%<sup>[7](https://nearform.com/work/starbucks-progressive-web-app)</sup> |
| 能耗权衡 | 2023 年一项针对 10 个 Android 内容平台的研究发现，原生应用的能耗显著低于对应的 Web 应用，效应量很大<sup>[8](https://arxiv.org/abs/2308.16734)</sup> |

## 核心技术

归根结底，PWA 就是一个网站：至少有一个加载 CSS 和 [JavaScript](https://www.edgepedia.org/zh/javascript) 的 HTML 页面，可以访问与其他任何页面相同的 Web API。在这个基础之上，还有两样东西。<sup>[1](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app)</sup>

**Web 应用清单。** 清单是一个 JSON 文件，通过页面中的 `<link rel="manifest">` 元素引入，用来告诉浏览器该应用在设备上应如何呈现、如何运作。它至少必须提供浏览器安装 PWA 所需的信息，例如应用名称和图标；它还可以定义主题色与背景色，以及诸如充当其他应用数据的分享目标、处理特定文件类型等行为。<sup>[1](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app)</sup><sup> • </sup><sup>[3](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable)</sup> W3C 的 Web 应用清单规范指出，任何网站都是可安装的 Web 应用；已安装的应用与书签的区别在于，应用启动时会应用清单中的各项成员，例如在主屏幕、启动器或开始菜单上显示为一个带标签的图标。<sup>[9](https://www.w3.org/TR/appmanifest/)</sup>

**Service Worker。** Service Worker 是浏览器可以在需要时于后台启动的脚本，例如用来处理推送通知。与所有 Web Worker 一样，它运行在与页面主 JavaScript 分离的线程中。Service Worker 鼓励这样一种架构：应用的页面负责实现用户界面，而 Service Worker 负责实现支持离线与后台运行的后端，这使 PWA 的行为更像应用而非网站。<sup>[1](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app)</sup> 当应用请求某个资源时，浏览器会在 Service Worker 的全局作用域中触发 `fetch` 事件，Worker 便可以从缓存而非网络提供该资源。<sup>[10](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Offline_and_background_operation)</sup> Service Worker 管理的缓存完全由脚本控制：它们不跨源共享，与浏览器的 [HTTP](https://www.edgepedia.org/zh/http) 缓存完全隔离，也不会自动更新或过期；开发者必须显式地管理它们。<sup>[11](https://www.w3.org/TR/service-workers/)</sup>

PWA 的安装并不需要 Service Worker，但 Service Worker 常被用来提供至少最低限度的离线体验。<sup>[1](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app)</sup>

## 架构与渐进增强

PWA 常被实现为单页应用，即网站只由一个 HTML 页面构成，用户浏览时由 JavaScript 获取新内容并更新页面，因为单页应用更容易实现无缝的界面。不过，PWA 不必是单页应用，单页应用也不必是 PWA。<sup>[1](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app)</sup>

**渐进增强**是这一模式的核心：用户在浏览器中输入 URL 访问 PWA 时，可以像使用普通网站一样与之交互；如果浏览器能够安装它，用户会收到提示，应用便作为设备上的一项新功能出现。PWA 应当对高级 API 进行特性检测，并提供可接受的回退体验，因为它们预期要在各种各样的设备和浏览器上运行。<sup>[1](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app)</sup> 一种相关的模式是应用外壳架构：支撑用户界面的最小量 HTML、CSS 和 JavaScript 快速加载，由 Service Worker 缓存，并通过 API 动态拉取内容；这个外壳相当于为原生应用发布到应用商店的那一捆代码。<sup>[12](https://developer.chrome.com/blog/app-shell?authuser=80)</sup>

## 可安装性

一个 Web 应用要获得支持安装的浏览器的安装提示，就必须满足若干技术要求，MDN 将其描述为 Web 应用成为 PWA 的最低要求。它必须通过 `https` 提供，开发时也可以来自 `localhost` 或 `127.0.0.1`，并且必须包含清单。包括 Google Chrome、三星浏览器（Samsung Internet）和 [Microsoft Edge](https://www.edgepedia.org/zh/microsoft-edge) 在内的基于 [Chromium](https://www.edgepedia.org/zh/chromium-web-browser) 的浏览器要求清单包含 `name` 或 `short_name`、192 像素与 512 像素的图标、`start_url`、`display` 和/或 `display_override`，以及 `prefer_related_applications` 设为 `false` 或缺失。<sup>[3](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable)</sup>

这些标准随着时间推移逐渐放宽。Chrome 的安装能力曾受若干质量标准限制，包括清单须含特定字段、Service Worker 须带 fetch 处理函数，但网站为了通过检查，纷纷添加带空 fetch 处理函数的 Service Worker，反而损害了性能。Chrome 在移动端 108 版、桌面端 112 版中取消了菜单安装对 `fetch()` 处理函数的要求，并为未自行实现的网站推出了默认离线页面。<sup>[4](https://developer.chrome.com/blog/update-install-criteria?authuser=5)</sup> 《Web 年鉴》（Web Almanac）2025 年版指出，如今 Chromium 浏览器只需有清单就会显示安装提示，HTTPS 连接的要求仍然保留。<sup>[13](https://cdn.httparchive.org/v1/static/almanac/ebooks/web_almanac_2025_en.pdf)</sup> Safari 走得更远：在 iOS 26 与 iPadOS 26 中，添加到主屏幕的任何网站默认都以 Web 应用方式打开，Safari 如今对可安装性没有任何要求，不过提供清单时其好处依然存在。<sup>[5](https://webkit.org/blog/17333/webkit-features-in-safari-26-0/)</sup>

安装之后，PWA 在用户看来就是一个平台专属应用：它与原生应用并排获得应用图标，可以作为独立应用启动，而不是在浏览器里作为网站打开。<sup>[3](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable)</sup> 各浏览器的支持情况不尽相同。在 Android 上，只有搭载 [Google Mobile Services](https://www.edgepedia.org/zh/google-mobile-services) 的设备上的 Chrome，以及三星设备上的三星浏览器，会把 PWA 安装为 WebAPK，使其在应用启动器和系统设置中获得真正的条目；其他浏览器只是添加一个带浏览器标记的主屏幕快捷方式。在 iOS 16.3 及更早版本中，PWA 只能用 Safari 安装；从 iOS 16.4 起，可以通过 Safari、Chrome、Edge、Firefox 和 Orion 的分享菜单安装。<sup>[3](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable)</sup>

## 离线与后台运行

Service Worker 的缓存能力是 PWA 在没有网络时仍能继续工作的关键。例如，一个音乐应用可以在线时流式播放、在后台下载曲目，并在离线时继续播放。<sup>[10](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Offline_and_background_operation)</sup> 由于 Service Worker 可以由浏览器在后台启动，它们还支持在应用未打开时处理推送通知等操作。<sup>[1](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app)</sup>

存储是这一能力的基础。用 [IndexedDB](https://www.edgepedia.org/zh/indexeddb)、Cache API 或 File System API 存储的数据由各浏览器特有的配额系统管理；[Web Storage](https://www.edgepedia.org/zh/web-storage) 每个源限制为 10 MiB，分为 5 MiB 的本地存储和 5 MiB 的会话存储。默认情况下，数据以尽力而为的方式存储，只要该源未超出配额且设备有空间就会一直保留；而被授予持久存储的源，只有在用户选择删除数据时才会被清除。<sup>[14](https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria)</sup>

## 历史

Google Chrome 工程师亚历克斯·拉塞尔于 2015 年 6 月发表了《Progressive Web Apps: Escaping Tabs Without Losing Our Soul》一文，描述了这样一种 Web 应用：它赢得主屏幕上的一席之地，保留 Web 基于 URL 的本质，并且可以离线工作，而 Service Worker 是这一愿景的核心特性。<sup>[15](https://medium.com/%40slightlylate/progressive-apps-escaping-tabs-without-losing-our-soul-3b93a8561955)</sup><sup> • </sup><sup>[16](https://daverupert.com/2015/06/progressive-apps/)</sup> 这个名字本身来自贝里曼与拉塞尔的这次合作。<sup>[2](https://prismatic-technologies.com/assets/images/erp.pdf)</sup> Chrome 在移动端的安装能力始于 2015 年，桌面端 PWA 安装于 2019 年加入；当年的 Chrome 73 将 PWA 支持带到 macOS，从而完成了对 Mac、Windows、ChromeOS、Linux 以及移动端的全面支持。<sup>[4](https://developer.chrome.com/blog/update-install-criteria?authuser=5)</sup><sup> • </sup><sup>[17](https://developer.chrome.com/blog/new-in-chrome-73)</sup>

iOS 上的平台支持发展得更晚，也更不均衡。2023 年，iOS 与 iPadOS 16.4 为主屏幕 Web 应用加入了 Web 推送，通知会出现在锁定屏幕、[通知中心](https://www.edgepedia.org/zh/notification-center)以及配对的 [Apple Watch](https://www.edgepedia.org/zh/apple-watch) 上，同时还加入了徽章 API 和对清单 `id` 成员的支持。<sup>[6](https://webkit.org/blog/13878/web-push-for-web-apps-on-ios-and-ipados/)</sup> 2025 年，WebKit 在 iOS 与 iPadOS 18.4 上引入了声明式 Web 推送（Declarative Web Push），无需 Service Worker 即可显示推送通知，理由是要求使用 Service Worker 增加了开发工作的复杂度，并额外消耗电池和 CPU 资源。<sup>[18](https://webkit.org/blog/16574/webkit-features-in-safari-18-4/)</sup>

## PWA 与原生应用的比较

PWA 模式的主要吸引力在于：单一代码库通过 Web 交付，无需应用商店即可安装，并且可以通过 URL 分享。主要代价则体现在资源占用和平台访问能力上。2023 年一项针对 Android 上 10 个互联网内容平台的实证研究发现，原生应用的能耗显著低于对应的 Web 应用，效应量很大，且 Web 应用占用更多 CPU 和内存，差异具有统计学显著性；作者建议用户尽可能使用原生应用访问互联网内容。<sup>[8](https://arxiv.org/abs/2308.16734)</sup> 不过，一项关于 PWA 能耗的比较研究指出，Twitter 的 PWA 只使用了 Twitter Android 原生应用所占设备存储的 3%。<sup>[19](https://www.sciencedirect.com/science/article/pii/S0306437922000230)</sup>

**案例研究。** 早期采用者报告的商业成果相当可观。速卖通（AliExpress）在构建 PWA 之后，新用户转化率提升了 104%，Safari 上的转化率提升了 82%，每次会话访问的页面数翻了一倍，每次会话的停留时间增加了 74%。<sup>[20](https://web.dev/case-studies/aliexpress?hl=en)</sup> [星巴克](https://www.edgepedia.org/zh/starbucks)用一个小巧自足的 233 KB 点单 PWA 取代了多个静态的门店定位网站，它比其 148 MB 的 iOS 应用小 99.84%，可以立即加载，而不是一点一点地加载。<sup>[7](https://nearform.com/work/starbucks-progressive-web-app)</sup> 汇总的行业统计数据显示，Konga 的 PWA 首次加载所用的数据比其原生应用少 92%，完成用户首次交易所用的数据少 82%；在较旧设备上，Lyft 用户在 PWA 中叫车的次数比原生应用用户多 11%，点击“安装 PWA”的频率比点击“下载应用”高 40%。<sup>[21](https://progressier.com/pwa-stats/brand/starbucks)</sup>

这种比较仍取决于平台。推送通知曾是原生应用的一项明显优势，而 2023 年 iOS 16.4 已让主屏幕 Web 应用获得了这一能力。<sup>[6](https://webkit.org/blog/13878/web-push-for-web-apps-on-ios-and-ipados/)</sup>

## References

1. [What is a progressive web app? MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/What_is_a_progressive_web_app)
2. [Progressive Web Apps: The Possible Web-native Unifier for Mobile (term origin: Frances Berriman and Alex Russell, 2015)](https://prismatic-technologies.com/assets/images/erp.pdf)
3. [Making PWAs installable, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable)
4. [Revisiting Chrome's installability criteria, Chrome for Developers](https://developer.chrome.com/blog/update-install-criteria?authuser=5)
5. [WebKit Features in Safari 26.0, WebKit](https://webkit.org/blog/17333/webkit-features-in-safari-26-0/)
6. [Web Push for Web Apps on iOS and iPadOS, WebKit](https://webkit.org/blog/13878/web-push-for-web-apps-on-ios-and-ipados/)
7. [Starbucks: ordering and store locator progressive web app, Nearform](https://nearform.com/work/starbucks-progressive-web-app)
8. [Native vs Web Apps: Comparing the Energy Consumption and Performance of Android Apps and their Web Counterparts, arXiv:2308.16734](https://arxiv.org/abs/2308.16734)
9. [Web Application Manifest, W3C](https://www.w3.org/TR/appmanifest/)
10. [Offline and background operation, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Offline_and_background_operation)
11. [Service Workers, W3C](https://www.w3.org/TR/service-workers/)
12. [Instant Loading Web Apps with an Application Shell Architecture, Chrome for Developers](https://developer.chrome.com/blog/app-shell?authuser=80)
13. [The 2025 Web Almanac by HTTP Archive](https://cdn.httparchive.org/v1/static/almanac/ebooks/web_almanac_2025_en.pdf)
14. [Storage quotas and eviction criteria, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria)
15. [Progressive Web Apps: Escaping Tabs Without Losing Our Soul, Alex Russell](https://medium.com/%40slightlylate/progressive-apps-escaping-tabs-without-losing-our-soul-3b93a8561955)
16. [Progressive Apps: Escaping Tabs Without Losing Our Soul, daverupert.com](https://daverupert.com/2015/06/progressive-apps/)
17. [New in Chrome 73, Chrome for Developers](https://developer.chrome.com/blog/new-in-chrome-73)
18. [WebKit Features in Safari 18.4, WebKit](https://webkit.org/blog/16574/webkit-features-in-safari-18-4/)
19. [A comparative study on the energy consumption of Progressive Web Apps, ScienceDirect](https://www.sciencedirect.com/science/article/pii/S0306437922000230)
20. [AliExpress case study, web.dev](https://web.dev/case-studies/aliexpress?hl=en)
21. [PWA stats: Starbucks brand page, Progressier](https://progressier.com/pwa-stats/brand/starbucks)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Application software by domain

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/progressive-web-app

English original: https://www.edgepedia.org/progressive-web-app
