diff --git a/src/permap.ml b/src/permap.ml index edf1b59..f17f7ed 100644 --- a/src/permap.ml +++ b/src/permap.ml @@ -304,7 +304,14 @@ let get_post_image ~thumbnail request = | Ok image_opt -> ( match image_opt with | None -> Dream.respond ~status:`Not_Found "Image does not exists" - | Some image -> Dream.respond ~headers:[ ("Content-Type", "image") ] image ) + | Some image -> + (* posts images do not change so we cache them *) + Dream.respond + ~headers: + [ ("Cache-Control", "max-age=3628800, immutable") + ; ("Content-Type", "image") + ] + image ) let get_avatar_image request = let nick = Dream.param request "user" in