shawn-mcginty / naboris

Simple, fast, minimalist http server for OCaml/ReasonML
https://naboris.dev
MIT License
71 stars 4 forks source link

Add support for caching #44

Closed shawn-mcginty closed 4 years ago

shawn-mcginty commented 4 years ago

Add cache response headers

  1. Add (weak) ETag header to all GET responses (make this configurable)
  2. Add Date header to all GET responses (make this configurable)
  3. Add Last-Modified header to static responses (make this configurable)
  4. Add Cache-Control: public, max-age=0 to static responses (make this configurable)

Support conditional requests https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests (except for If-Range)

shawn-mcginty commented 4 years ago

Decided against conditional request implementation. This can be done via middle-ware.