Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: mention the behavior of [Dream.static] wrt (lack of) caching #316

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/dream.mli
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,11 @@ val static :

The default loader is {!Dream.from_filesystem}. See example
{{:https://github.com/aantron/dream/tree/master/example/w-one-binary#files}
[w-one-binary]} for a loader that serves files from memory instead. *)
[w-one-binary]} for a loader that serves files from memory instead.

Note that no caching-related headers are sent in the response. If you want
caching, one option is to pass [~static:custom_loader] where the custom
loader calls {!Dream.from_filesystem} and then adds appropriate headers. *)

val from_filesystem : string -> string -> handler
(** [Dream.from_filesystem local_directory path request] responds with a file
Expand Down
Loading