HTTP delivery optimizations: stale-while-revalidate, Range/206 delta fetch, SW precache (PROTOCORE_ENABLE_HTTP_DELIVERY).
More...
HTTP delivery optimizations: stale-while-revalidate, Range/206 delta fetch, SW precache (PROTOCORE_ENABLE_HTTP_DELIVERY).
Three pure cores that make HTTP serving cheaper on a constrained device, each mapping to a real web standard:
- Stale-while-revalidate (RFC 5861): given a cached response's age and its max-age + stale-while-revalidate windows, decide FRESH / serve-stale-and-revalidate / EXPIRED, and build the matching Cache-Control header so a browser keeps the UI responsive while the device refreshes in the background.
- Delta / offset log fetch (RFC 7233 byte ranges): parse a Range: bytes=... request against a resource of known length (all three forms - X-Y, X-, -N), and build the Content-Range header for the 206 Partial Content reply, so a client streams only the new tail of a growing log.
- Service-worker precache manifest: emit the versioned {"version":..,"precache":[..]} JSON a generated service worker consumes to cache-inject the app shell for offline / instant loads.
Pure, zero heap, no stdlib (hand-rolled decimal parse/format), host-testable.
Definition in file http_delivery.h.