907c7654

Author: Michael Lynch <git@mtlynch.io>

Committer: Michael Lynch <mtlynch@noreply.codeberg.org>

Add ETag caching and Cache-Control headers for static assets (#45)

Wrap the static file server with middleware that sets a Cache-Control
header (public, max-age=1800) and generates per-process ETag values
based on a SHA-256 hash of the startup timestamp and request path.
When the client sends a matching If-None-Match header, the server
responds with 304 Not Modified and an empty body.

Co-authored-by: Shelley <shelley@exe.dev>

Reviewed-on: https://codeberg.org/mtlynch/go-app-starter/pulls/45
Co-authored-by: Michael Lynch <git@mtlynch.io>
Co-committed-by: Michael Lynch <git@mtlynch.io>

Suite timing

Time to Start Worker time Duration Time to finish
Config 5s 1s 1s 7s
Eval 7s 32s 32s 39s
Build 4m59s 4m12s 1m37s 6m37s
Test - - - -
Deploy - - - -
Suite 5s 4m46s 6m32s 6m37s

Timeline

0s10s20s30s5m5m10s5m20s5m30s5m40s5m50s6m6m10s6m20s6m30s