Intermediate LevelREST APIs & Web Services
Why was HTTP/2 Server Push deprecated and replaced by 103 Early Hints?
❓ Interview Prompt: Explain HTTP/2 Server Push limitations (over-pushing cached assets), browser deprecation, and `103 Early Hints` informational status.
Why HTTP/2 Server Push Failed:
HTTP/2 Server Push allowed servers to send un-requested assets to clients. However, servers could not reliably know if the browser already had those assets cached, wasting bandwidth over-pushing duplicates!
103 Early Hints Replacement (RFC 8297):
Server returns an informational '103 Early Hints' status containing 'Link: </style.css>; rel=preload' headers BEFORE finishing main database queries, allowing browsers to prefetch resources while waiting for server rendering!
Code Implementation Example
http
// Server sends 103 Early Hints immediately while processing DB query:
HTTP/1.1 103 Early Hints
Link: </css/main.css>; rel=preload; as=style
Link: </js/app.js>; rel=preload; as=script
// Final response sent when rendering finishes:
HTTP/1.1 200 OK
Content-Type: text/html💡103 Early Hints HTTP response preloading CSS/JS assets.
🎯 Interview Key Takeaway
Use 103 Early Hints instead of deprecated HTTP/2 Server Push to inform browsers to preload critical assets while server queries run.
#103 Early Hints#HTTP/2 Push#Performance#Intermediate
Back to all REST APIs & Web Services Questions→