DeterministicESPAsyncWebServer v6.28.0
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
http_delivery.h File Reference

HTTP delivery optimizations: stale-while-revalidate, Range/206 delta fetch, SW precache (DETWS_ENABLE_HTTP_DELIVERY). More...

#include "ServerConfig.h"
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Detailed Description

HTTP delivery optimizations: stale-while-revalidate, Range/206 delta fetch, SW precache (DETWS_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.