Have you ever experienced a feature that seemed fantastic in theory but did not perform very well in reality? This is essentially the case with
HTTP/2 Server Push. Lots of developers thought it would speed up websites and all it really ended up doing was causing more trouble than it was worth.
What Server Push Was Supposed To Do
Server Push tried to improve the speed of websites by pushing files to the browser before the browser actually requested those files. The concept was simple: "I can probably guess what you need, and push it ahead of time." However, guessing is not always a good option.
Server Push Did Not Work Well Because
It Sent Too Many Files
In truth,
Server Push sent files that the browser already had in its cache. This wasted users' bandwidth and slowed everything down. All while
web hosts were seeing a coordinated increase in their network usage for no good reason.
It Clashed With Browser Logic.
Browsers tend to know the best way to load pages. Server Push essentially ignored everything the browser might want to do and announced, "I know better."
It resulted in waiting and confusion rather than speed.
It Caused Real Performance Problems
Many developers would test
Server Push and discover that pages loaded even slower. Some files showed up prematurely, others too late. This made the entire flow of the system feel chaotic.
What Replaced Server Push?
Fortunately, a better tool came along: a tool that actually helps performance.
Preload
Preload lets you essentially say to the browser, "You will need this file shortly."The browser will then determine when to download it. This works much faster and smoothly, because the browser is in control.
HTTP/3 and QUIC
HTTP/3 employs the
QUIC protocol which is much more effective at dealing with bad networks and slow connections. This protocol alone ensures many websites load quickly without needing any tricks.
Service Workers
Service Workers are like smart helpers inside the browser.
They:
- Cache files
- Load pages quickly
- Work offline
- Reduce server load
They do everything
Server Push attempted to do, but much more effective.