a web application that aims to provide a native-like experience through progressive enhancement. » This concept has been pushed strongly by Google; they have added a number of features to Chrome specifically for PWAs. » Nevertheless, PWA designs can provide improved experiences on all devices, not just ones running Chrome.
number of progressive web apps for retailers using React and Redux. » We have created a toolkit to develop these apps quickly. » This toolkit reflects our current best practices, including for performance.
in our apps in a Redux store. » This includes both UI state, and data received from the backend. » With the right store schema, we can make maximum use of the backend data to provide a smooth, high-performance experience for the user. » These techniques do not depend on new web features, so they work on all platforms.
page that are all based on the same template, such as category pages » For these classes, we make sure that the contents of all pages are kept in the store, allowing very fast transitions between already-loaded pages.
of the data fetched from the backend may be relevant for other pages as well. » For example, a category page may include titles of products, prices, and product images » If we store this information where the relevant product page can find it, then when navigating to the product, we already have basic information available.
app to register a Javascript program to control caching. » The service worker code has full control over HTTP requests made by pages in its scope. » It can satisfy these requests with actual network requests, or with generated or cached data that does not require a network roundtrip. » Service workers are implemented on most browsers and platforms, but not iOS or Safari.
reloads are much more common than they would be in the past, due to browsers' aggressive reclamation of memory and other resources. » Service worker caching can dramatically speed up page reloads, preventing network round-trips for some or all of the necessary assets. » To do this, we must judiciously choose our caching strategy to avoid unnecessary delays.
worker caching » It provides a mechanism for associating URL patterns with caching strategies, and includes implementations of most basic caching Strategies » It also handles cache expiration, which is not handled automatically by the worker cache API
to the server, falling back to a cached response if the server is unreachable. » This strategy is the most cautious in ensuring the data is up to date, but requires a network roundtrip to complete for every resource before it is returned to the page.
returned if it is available, only fetching from the server if it is not present in the cache. » This strategy is the fastest, but ignores all changes to the resource after it is first fetched. This is useful for cache- broken assets which can be assumed to never change.
and the network that responds faster will be used. The network request will always be made and the result will be cached if it is successful. » This strategy will, effectively, always return the cached value immediately if it exists, but update it in the background from the network
use for our PWA builds uses all three of these strategies. » Cache-first is used for the webpack bundle assets and web fonts, which are all cache-broken » Fastest is used for images, keeping the last 15 images in the cache. » Network-first is used for all other resources.