fix add Cache-Control header to static assets

Sets max-age=86400 (24h) so browsers cache static files instead of refetching on every page load.

Commit
9bb13ccc5737985ba58d92d0a62baf9626a0e528
Author
Marius Peter <dev@marius-peter.com>
Author date
Committer
Marius Peter <dev@marius-peter.com>
Committer date
lib/static_handler.ml
index 3b5af955..7e71a2a0 100644..100644
@@ -20,5 +20,11 @@
20 20 match Static_assets.read path with
21 21 | Some content ->
22 22 let content_type = Filename.extension path |> content_type_of_ext in
23 Removed: Dream.respond ~headers:[ ("Content-Type", content_type) ] content
23 Added: Dream.respond
24 Added: ~headers:
25 Added: [
26 Added: ("Content-Type", content_type);
27 Added: ("Cache-Control", "public, max-age=86400");
28 Added: ]
29 Added: content
24 30 | None -> Dream.respond ~status:`Not_Found "Not found"