Web Service Worker
   HOME

TheInfoList



OR:

A progressive web application (PWA), or progressive web app, is a type of
web app A web application (or web app) is application software that is created with World Wide Web, web technologies and runs via a web browser. Web applications emerged during the late 1990s and allowed for the server to Dynamic web page, dynamically ...
that can be installed on a device as a standalone application. PWAs are installed using the offline cache of the device's
web browser A web browser, often shortened to browser, is an application for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's scr ...
. PWAs were introduced from 2016 as an alternative to
native Native may refer to: People * '' Jus sanguinis'', nationality by blood * '' Jus soli'', nationality by location of birth * Indigenous peoples, peoples with a set of specific rights based on their historical ties to a particular territory ** Nat ...
(device-specific) applications, with the advantage that they do not require separate bundling or distribution for different platforms. They can be used on a range of different systems, including
desktop A desktop traditionally refers to: * The surface of a desk (often to distinguish office appliances that fit on a desk, such as photocopiers and printers, from larger equipment covering its own area on the floor) Desktop may refer to various compu ...
and
mobile device A mobile device or handheld device is a computer small enough to hold and operate in hand. Mobile devices are typically battery-powered and possess a flat-panel display and one or more built-in input devices, such as a touchscreen or keypad. ...
s. Publishing the app to digital distribution systems, such as the
Apple App Store The App Store is an app marketplace developed and maintained by Apple, for mobile apps on its iOS and iPadOS operating systems. The store allows users to browse and download approved apps developed within Apple's iOS SDK. Apps can be download ...
,
Google Play Google Play, also known as the Google Play Store, Play Store, or sometimes the Android Store (and was formerly Android Market), is a digital distribution service operated and developed by Google. It serves as the official app store for certifie ...
, or the
Microsoft Store The Microsoft Store (formerly known as the Windows Store) is a digital distribution platform operated by Microsoft. It was created as an app store for Windows 8 as the primary means of distributing Universal Windows Platform apps. With ...
on Windows, is optional. Because a PWA is delivered in the form of a
webpage A web page (or webpage) is a Web document that is accessed in a web browser. A website typically consists of many web pages linked together under a common domain name. The term "web page" is therefore a metaphor of paper pages bound together in ...
or
website A website (also written as a web site) is any web page whose content is identified by a common domain name and is published on at least one web server. Websites are typically dedicated to a particular topic or purpose, such as news, educatio ...
built using common web technologies including
HTML Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It defines the content and structure of web content. It is often assisted by technologies such as Cascading Style Sheets ( ...
, CSS,
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
, and
WebAssembly WebAssembly (Wasm) defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating communication between such programs and their host environment. The main goal of ...
, it can work on any platform with a PWA-compatible browser. As of 2021, PWA features are supported to varying degrees by
Google Chrome Google Chrome is a web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS, iOS, iPadOS, an ...
,
Apple Safari Safari is a web browser developed by Apple Inc., Apple. It is built into several of List of Apple operating systems, Apple's operating systems, including macOS, iOS, iPadOS, and visionOS, and uses Apple's open-source software, open-source bro ...
, Brave, Firefox for Android, and
Microsoft Edge Microsoft Edge is a Proprietary Software, proprietary cross-platform software, cross-platform web browser created by Microsoft and based on the Chromium (web browser), Chromium open-source project, superseding Edge Legacy. In Windows 11, Edge ...
but not by
Firefox Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements curr ...
for desktop.


History


Predecessors

At Apple's
Worldwide Developers Conference The Worldwide Developers Conference (WWDC) is an information technology conference held annually by Apple Inc. The conference is currently held at Apple Park in California. The event is used to showcase new software and technologies in the macO ...
in 2007,
Steve Jobs Steven Paul Jobs (February 24, 1955 – October 5, 2011) was an American businessman, inventor, and investor best known for co-founding the technology company Apple Inc. Jobs was also the founder of NeXT and chairman and majority shareholder o ...
announced that the
iPhone The iPhone is a line of smartphones developed and marketed by Apple that run iOS, the company's own mobile operating system. The first-generation iPhone was announced by then–Apple CEO and co-founder Steve Jobs on January 9, 2007, at ...
would "run applications created with Web 2.0 Internet standards". No
software development kit A software development kit (SDK) is a collection of software development tools in one installable package. They facilitate the creation of applications by having a compiler, debugger and sometimes a software framework. They are normally specific t ...
(SDK) was required, and the apps would be fully integrated into the device through the
Safari A safari (; originally ) is an overland journey to observe wildlife, wild animals, especially in East Africa. The so-called big five game, "Big Five" game animals of Africa – lion, African leopard, leopard, rhinoceros, African elephant, elep ...
browser engine. This model was later switched to the
App Store An app store, also called an app marketplace or app catalog, is a type of digital distribution platform for computer software called applications, often in a mobile context. Apps provide a specific set of functions which, by definition, do not i ...
, as a means of appeasing frustrated developers. In October 2007 Jobs announced that an SDK would be launched the following year. As a result, although Apple continued to support web apps, the vast majority of iOS applications shifted toward the App Store. Beginning in the early 2010s
dynamic web page A dynamic web page is a web page constructed at runtime (during software execution), as opposed to a ''static web page'', delivered as it is stored. A server-side dynamic web page is a web page whose construction is controlled by an application ...
s allowed web technologies to be used to create interactive
web application A web application (or web app) is application software that is created with web technologies and runs via a web browser. Web applications emerged during the late 1990s and allowed for the server to dynamically build a response to the request, ...
s.
Responsive web design Responsive web design (RWD) or responsive design is an approach to web design that aims to make web pages render well on a variety of devices and window or screen sizes from minimum to maximum display size to ensure usability and satisfactio ...
, and the screen-size flexibility it provides have made PWA development more accessible. Continued enhancements to HTML, CSS, and JavaScript allowed web applications to incorporate greater levels of interactivity, making native-like experiences possible on a website. In 2013, Mozilla released
Firefox OS Firefox OS (project name: ''Boot to Gecko'', also known as ''B2G'') is a discontinued Open-source software, open-source operating system made for smartphones, tablet computers, smart TVs, and Matchstick TV, dongles designed by Mozilla and exte ...
. It was intended to be an
open-source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
for running web apps as native apps on mobile devices. Firefox OS was based on the
Gecko Geckos are small, mostly carnivorous lizards that have a wide distribution, found on every continent except Antarctica. Belonging to the infraorder Gekkota, geckos are found in warm climates. They range from . Geckos are unique among lizards ...
rendering engine with a user interface called Gaia, written in HTML5. The development of Firefox OS ended in 2016, and the project was completely discontinued in 2017, although a fork of Firefox OS was used as the basis of
KaiOS KaiOS is a mobile Linux distribution for keypad-based mobile phones. It is designed and optimised for affordable and low-power feature phones, while retaining access to Internet services through web apps, based on the Gecko engine. KaiOS was ...
, a feature phone platform.


Initial introduction

In 2015, designer Frances Berriman and
Google Chrome Google Chrome is a web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS, iOS, iPadOS, an ...
engineer Alex Russell coined the term "progressive web apps" to describe apps taking advantage of new features supported by modern browsers, including service workers and web app manifests, that let users upgrade web apps to progressive web applications in their native
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
(OS). Google then put significant efforts into promoting PWA development for Android. Firefox introduced support for service workers in 2016, and Microsoft Edge and Apple Safari followed in 2018, making service workers available on all major systems. By 2019, PWAs were supported by desktop versions of some browsers, including
Microsoft Edge Microsoft Edge is a Proprietary Software, proprietary cross-platform software, cross-platform web browser created by Microsoft and based on the Chromium (web browser), Chromium open-source project, superseding Edge Legacy. In Windows 11, Edge ...
(on
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
) and
Google Chrome Google Chrome is a web browser developed by Google. It was first released in 2008 for Microsoft Windows, built with free software components from Apple WebKit and Mozilla Firefox. Versions were later released for Linux, macOS, iOS, iPadOS, an ...
(on Windows,
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
,
ChromeOS ChromeOS, sometimes styled as chromeOS and formerly styled as Chrome OS, is an operating system designed and developed by Google. It is derived from the open-source operating system and uses the Google Chrome web browser as its principal user ...
, and
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
). In December 2020, Firefox for desktop abandoned the implementation of PWAs (specifically, removed the prototype "
site-specific browser A site-specific browser (SSB) is a software application that is dedicated to accessing pages from a single source (site) on a computer network such as the Internet or a private intranet. SSBs typically simplify the more complex functions of a web ...
" configuration that had been available as an experimental feature). A Firefox architect noted: "The signal I hope we are sending is that PWA support is not coming to desktop Firefox anytime soon." Mozilla supports PWAs on Android and plans to keep supporting it.


Browser support


Characteristics

Progressive web apps are all designed to work on any browser that is compliant with the appropriate
web standards Web standards are the formal, non-proprietary standards and other technical specifications that define and describe aspects of the World Wide Web. In recent years, the term has been more frequently associated with the trend of endorsing a set of st ...
. As with other cross-platform solutions, the goal is to help developers build cross-platform apps more easily than they would with native apps. Progressive web apps employ the
progressive enhancement Progressive enhancement is a strategy in web design that puts emphasis on web content first, allowing everyone to access the basic content and functionality of a web page, while users with additional browser features or faster Internet access r ...
web development strategy. Some progressive web apps use an architectural approach called the App Shell Model. In this model, service workers store the Basic User Interface or "
shell Shell may refer to: Architecture and design * Shell (structure), a thin structure ** Concrete shell, a thin shell of concrete, usually with no interior columns or exterior buttresses Science Biology * Seashell, a hard outer layer of a marine ani ...
" of the
responsive web design Responsive web design (RWD) or responsive design is an approach to web design that aims to make web pages render well on a variety of devices and window or screen sizes from minimum to maximum display size to ensure usability and satisfactio ...
web application in the browser's offline
cache Cache, caching, or caché may refer to: Science and technology * Cache (computing), a technique used in computer storage for easier data access * Cache (biology) or hoarding, a food storing behavior of animals * Cache (archaeology), artifacts p ...
. This model allows for PWAs to maintain native-like use with or without web connectivity. This can improve loading time, by providing an ''initial static frame'', a layout or architecture into which content can be loaded progressively as well as dynamically.


Technical criteria

The technical baseline criteria for a site to be considered a progressive web app and therefore capable of being installed by browsers were described by Russell in 2016 and updated since: * Originate from a secure origin. Served over TLS and have no active mixed content. Progressive web apps must be served via
HTTPS Hypertext Transfer Protocol Secure (HTTPS) is an extension of the Hypertext Transfer Protocol (HTTP). It uses encryption for secure communication over a computer network, and is widely used on the Internet. In HTTPS, the communication protoc ...
to ensure user privacy, security, and content authenticity. * Register a service worker with a fetch handler. Progressive web apps must use service workers to create programmable content caches. Unlike regular HTTP
web cache A web cache (or HTTP cache) is a system for optimizing the World Wide Web. It is implemented both client-side and server-side. The caching of multimedia and other files can result in less overall delay when web browser, browsing the Web. Parts o ...
, which caches content after the first use and then rely on various heuristics to guess when content is no longer needed, programmable caches can explicitly prefetch content in advance ''before'' it's used for the first time and explicitly discard it when it is no longer needed. This requirement helps pages to be accessible offline or on low-quality networks. * Reference a web app
manifest Manifest may refer to: Computing * Manifest file, a metadata file that enumerates files in a program or package * Manifest (CLI), a metadata text file for CLI assemblies Events * Manifest (convention), a defunct anime festival in Melbourne, Au ...
. The manifest must contain at least the five key properties: name or short_name, start_url, and display (with a value of standalone, fullscreen or minimal-ui), and icons (with 192 px and a 512 px versions). Information contained in the manifest makes PWAs easily shareable via a URL, discoverable by search engines, and alleviates complex installation procedures (but PWAs may still be listed in a third-party
app store An app store, also called an app marketplace or app catalog, is a type of digital distribution platform for computer software called applications, often in a mobile context. Apps provide a specific set of functions which, by definition, do not i ...
).W3
"Web App Manifest", Working Draft
retrieved 12 September 2016.
Furthermore, PWAs support native app-style interactions and navigation, including being added to the home screen, displaying splash screens, etc.


Technologies

There are many technologies commonly used to create progressive web apps. A web application is considered a PWA if it satisfies the installation criteria, thus can work offline and can be added to the device's home screen. To meet this definition, all PWAs require at minimum a manifest and a service worker. Other technologies may be used to store data, communicate with servers or execute code.


Manifest

The web app manifest is a
World Wide Web Consortium The World Wide Web Consortium (W3C) is the main international standards organization for the World Wide Web. Founded in 1994 by Tim Berners-Lee, the consortium is made up of member organizations that maintain full-time staff working together in ...
(W3C) specification defining a
JSON JSON (JavaScript Object Notation, pronounced or ) is an open standard file format and electronic data interchange, data interchange format that uses Human-readable medium and data, human-readable text to store and transmit data objects consi ...
-based manifest (usually labelled manifest.json) to provide developers with a centralized place to put
metadata Metadata (or metainformation) is "data that provides information about other data", but not the content of the data itself, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive ...
associated with a web application including: * The name of the web application * Links to the web app icons or image objects * The preferred URL to launch or open the web app * The web app configuration data * Default orientation of the web app * The option to set the display mode, e.g. full screen This metadata is crucial for an app to be added to a home screen or otherwise listed alongside native apps.


iOS support

iOS Ios, Io or Nio (, ; ; locally Nios, Νιός) is a Greek island in the Cyclades group in the Aegean Sea. Ios is a hilly island with cliffs down to the sea on most sides. It is situated halfway between Naxos and Santorini. It is about long an ...
Safari partially implements manifests, while most of the PWA metadata can be defined via Apple-specific extensions to the meta tags. These tags allow developers to enable full-screen display, define icons and splash screens, and specify a name for the application.


Service workers

A service worker is a
web worker A web worker, as defined by the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG), is a JavaScript script executed from an HTML page that runs in the background, independently of scripts that m ...
that implements a programmable network proxy that can respond to web/HTTP requests from the main document. It is able to check the availability of a remote server, cache content when that server is available, and serve that content to the document later. Service workers, like any other web workers, work separately from the main document context. Service workers can handle
push notifications Push technology, also known as server Push, refers to a communication method, where the communication is initiated by a server rather than a client. This approach is different from the "pull" method where the communication is initiated by a client ...
and synchronize data in the background, cache or retrieve resource requests, intercept network requests and receive centralized updates independently of the document that registered them, even when that document is not loaded. Service workers go through a three-step lifecycle of Registration, Installation and Activation. Registration involves telling the browser the location of the service worker in preparation for installation. Installation occurs when there is no service worker installed in the browser for the web app, or if there is an update to the service worker. Activation occurs when all of the PWA's pages are closed, so that there is no conflict between the previous version and the updated one. The lifecycle also helps maintain consistency when switching among versions of a service worker since only a single service worker can be active for a domain.


WebAssembly

WebAssembly allows precompiled code to run in a web browser, at near-native speed. Thus, libraries written in languages such as C can be added to web apps. Announced in 2015 and first released in March 2017, WebAssembly became a W3C recommendation on December 5, 2019 and it received the Programming Languages Software Award from ACM
SIGPLAN SIGPLAN is the Association for Computing Machinery's Special Interest Group (SIG) on programming languages. This SIG explores programming language concepts and tools, focusing on design, implementation, practice, and theory. Its members are progra ...
in 2021.


Data storage

Progressive Web App execution contexts get unloaded whenever possible, so progressive web apps need to store the majority of their long-term internal state (user data, dynamically loaded application resources) in one of the following manners: ;Web Storage:
Web Storage Web storage, formerly known as DOM storage (Document Object Model storage), is a standard JavaScript API provided by web browsers. It enables websites to store persistent data on users' devices similar to cookies, but with much larger capacity ...
is a W3C standard API that enables key-value storage in modern browsers. The API consists of two objects, sessionStorage (that enables session-only storage that gets wiped upon browser session end) and localStorage (that enables storage that persists across sessions). ;Indexed Database API:
Indexed Database API The Indexed Database API (commonly referred to as IndexedDB) is a JavaScript application programming interface (API) provided by web browsers for managing a NoSQL database of objects. It is a standard maintained by the World Wide Web Consortium ( ...
is a W3C standard database API available in all major browsers. The API is supported by modern browsers and enables storage of
JSON JSON (JavaScript Object Notation, pronounced or ) is an open standard file format and electronic data interchange, data interchange format that uses Human-readable medium and data, human-readable text to store and transmit data objects consi ...
objects and any structures representable as a string. The Indexed Database API can be used with a wrapper library providing additional constructs around it.


Comparison with native apps

In 2017,
Twitter Twitter, officially known as X since 2023, is an American microblogging and social networking service. It is one of the world's largest social media platforms and one of the most-visited websites. Users can share short text messages, image ...
released Twitter Lite, a PWA alternative to the official native Android and
iOS Ios, Io or Nio (, ; ; locally Nios, Νιός) is a Greek island in the Cyclades group in the Aegean Sea. Ios is a hilly island with cliffs down to the sea on most sides. It is situated halfway between Naxos and Santorini. It is about long an ...
apps. According to Twitter, Twitter Lite consumed only 1–3% of the size of the native apps.
Starbucks Starbucks Corporation is an American multinational List of coffeehouse chains, chain of coffeehouses and Starbucks Reserve, roastery reserves headquartered in Seattle, Washington. It was founded in 1971 by Jerry Baldwin, Zev Siegl, and Gor ...
provides a PWA that is 99.84% smaller than its equivalent iOS app. After deploying its PWA, Starbucks doubled the number of online orders, with desktop users ordering at about the same rate as mobile app users. A 2018 review published by
Forbes ''Forbes'' () is an American business magazine founded by B. C. Forbes in 1917. It has been owned by the Hong Kong–based investment group Integrated Whale Media Investments since 2014. Its chairman and editor-in-chief is Steve Forbes. The co ...
, found that users of
Pinterest Pinterest is an American social media service for publishing and discovery of information in the form of digital Bulletin board, pinboards. This includes recipes, home, style, motivation, and inspiration on the Internet using image sharing. Pint ...
's PWA spent 40% more time on the site compared to the previous mobile website. Ad revenue rates also increased by 44%, and core engagements by 60%.
Flipkart Flipkart Inc. is an Indian e-commerce company, headquartered in Bangalore, and incorporated in Singapore as a private limited company. The company initially focused on online book sales before expanding into other product categories such as con ...
saw 60% of customers who had uninstalled their native app return to use the Flipkart PWA. Lancôme saw an 84% decrease in time until the page is interactive, leading to a 17% increase in conversions and a 53% increase in mobile sessions on iOS with their PWA.


Release via app stores

Since a PWA does not require separate bundling or distribution for different platforms and is available to users via the web, it is not necessary for developers to release it over digital distribution systems like the
Apple App Store The App Store is an app marketplace developed and maintained by Apple, for mobile apps on its iOS and iPadOS operating systems. The store allows users to browse and download approved apps developed within Apple's iOS SDK. Apps can be download ...
,
Google Play Google Play, also known as the Google Play Store, Play Store, or sometimes the Android Store (and was formerly Android Market), is a digital distribution service operated and developed by Google. It serves as the official app store for certifie ...
,
Microsoft Store The Microsoft Store (formerly known as the Windows Store) is a digital distribution platform operated by Microsoft. It was created as an app store for Windows 8 as the primary means of distributing Universal Windows Platform apps. With ...
, or
Samsung Galaxy Store The Galaxy Store () is an app store offering apps, games and exclusive themes and other customizations for mobile devices manufactured by Samsung Electronics. The service is primarily supplied pre-installed on Samsung Galaxy smartphones and tabl ...
. The major app stores support the publication of PWAs to varying to degrees. Google Play, Microsoft Store, and Samsung Galaxy Store support PWAs, but Apple App Store does not. Microsoft Store publishes some qualifying PWAs automatically (even without app authors' requests) after discovering them via
Bing Bing most often refers to: * Bing Crosby (1903–1977), American singer * Microsoft Bing, a web search engine Bing may also refer to: Food and drink * Bing (bread), a Chinese flatbread * Bing (soft drink), a UK brand * Bing cherry, a varie ...
indexing.


See also

* Google Lighthouse, an open-source audit tool for PWAs developed by Google


References


External links


Web Applications Working Group
index of standards {{Web interfaces Web applications