\n\nStatic site content is stored in the (Service Worker) Cache Storage API enabling instant loading on repeat visits.\n\n## Performance tips\n\nWhile Preact is a drop-in that should work well for your PWA, it can also be used with a number of other tools and techniques. These include:\n\n
\n - \n \n
\n
Code-splitting breaks up your code so you only ship what the user needs for a page. Lazy-loading the rest as needed improves page load times. Supported via webpack or Rollup.
\n
\n \n - \n \n
\n
Service Worker caching allows you to offline cache static and dynamic resources in your app, enabling instant loading and faster interactivity on repeat visits. Accomplish this with Workbox
\n
\n \n - \n \n
\n
PRPL encourages preemptively pushing or pre-loading assets to the browser, speeding up the load of subsequent pages. It builds on code-splitting and SW caching.
\n
\n \n - \n \n
\n
Lighthouse allows you to audit the performance and best practices of your Progressive Web App so you know how well your app performs.
\n
\n \n
\n\n## Preact CLI\n\n[Preact CLI](https://github.com/preactjs/preact-cli/) is the official build tool for Preact projects. It's a single dependency command line tool that bundles your Preact code into a highly optimized Progressive Web App. It aims to make all of the above recommendations automatic, so you can focus on writing great Components.\n\nHere are a few things Preact CLI bakes in:\n\n- Automatic, seamless code-splitting for your URL routes\n- Automatically generates and installs a ServiceWorker\n- Generates HTTP2/Push headers (or preload meta tags) based on the URL\n- Pre-rendering for a fast Time To First Paint\n- Conditionally loads polyfills if needed\n\nSince [Preact CLI](https://github.com/preactjs/preact-cli/) is internally powered by [Webpack](https://webpack.js.org), you can define a `preact.config.js` and customize the build process to suit your needs. Even if you customize things, you still get to take advantage of awesome defaults, and can update as new versions of `preact-cli` are released.\n","meta":{"name":"Progressive Web Apps","permalink":"/guide/progressive-web-apps","description":"Progressive Web Apps (PWA) allow you to ship your app offline. They work pretty well with Preact","title":"Progressive Web Apps"}}