You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most pages share a common structure framing the "useful content".
Except for the <title> and some header metadata, it would be quite easy to reconstruct them by concatenating three resources: common header and footer for all pages, and content specific to each one of them.
This concatenation can be performed into browsers directly via a Service Worker, with the header and footer benefiting from HTTP caching, each page then being only "useful content". The server will have to be able to serve both the complete page, for the initial website access and for browsers that do not support Service Workers, and the page fragment without its header and footer, to be able to concatenate it in the Service Worker. Some and specific to referencing or sharing on social networks (and therefore useless in the browser) can be completely omitted from this fragment to further reduce its size. Others, as well as the <title>, can generally be positioned in the without impacting page's usability. Alternatively, they can be recreated by JavaScript, or injected directly into the by the Service Worker by concatenating not 3 parts, but 4 or 5 (these elements could be synthesized from the HTTP response headers of the page content, to maintain the same number of requests).
Here, we accept a bit of device processing time, an additional initial request for the Service Worker, and then two additional requests for headers and footers, in exchange for significant amounts of saved data on each page. These costs will be canceled by the savings while browsing the site (as for a SPA), but also during future visits, as long as the browser has not evicted the Service Worker.
Example
In early 2020, Philip Walton was able to measure a network exchange reduction of nearly 48% and performance improvements (First Contentful Paint) of more than 52% on his blog with this technique.