Documentation
¶
Overview ¶
Package etagjson serves JSON that is encoded once and tagged with a strong ETag, so an unchanged snapshot costs neither an encode nor a body. The client revalidates itself by sending If-None-Match; the response is never stored by an HTTP cache.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
func Serve(w http.ResponseWriter, r *http.Request, b Body)
Serve answers 304 when the request's If-None-Match names b, and the body otherwise. The response is no-store: the webview's HTTP cache leaks memory on WebKitGTK 2.50, so the app keeps the last answer and sends If-None-Match itself, which is what turns an unchanged snapshot into a 304.
Types ¶
Click to show internal directories.
Click to hide internal directories.