# Smaller HTML Payloads with Service Workers

DevFeed: [Smaller HTML Payloads with Service Workers](<https://devfeed.tech/articles/smaller-html-payloads-with-service-workers-29523.md>)

Original publisher: [Read original article](<https://philipwalton.com/articles/smaller-html-payloads-with-service-workers/>)

Published: 2020-01-07T08:02:37Z

Content type: article

Language: en

Sources: [Philip Walton](<https://devfeed.tech/sources/philip-walton.md>)

Topics: [Web Development](<https://devfeed.tech/topics/web-development.md>), [Caching](<https://devfeed.tech/topics/caching.md>), [Single-page application (SPA)](<https://devfeed.tech/topics/spa.md>), [browser](<https://devfeed.tech/topics/browser.md>)

Tags: [browser](<https://devfeed.tech/tags/browser.md>), [developers](<https://devfeed.tech/tags/developers.md>), [html](<https://devfeed.tech/tags/html.md>), [offline](<https://devfeed.tech/tags/offline.md>), [performance](<https://devfeed.tech/tags/performance.md>), [server](<https://devfeed.tech/tags/server.md>)

## AI overview

The article explains how service workers can reduce HTML payloads by requesting only page content and combining it with cached common elements to generate complete documents. On the author's site, this approach is reported to have reduced network payloads by 47.6% and improved median First Contentful Paint by 52.3% over the stated 30-day period.

## Source excerpt

Many developers know that you can use service workers to cache web pages (and their sub-resources) in order to serve those pages to users when they're offline. And while this is true, it's far from the only thing that service workers can do to improve the performance and reliability of a website. A lesser known capability of service workers is that you can programmatically generate your responses--you aren't limited to just fetching from the network or reading from the cache.