File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ testrun: build install
57
57
learn-ocaml build --repo $(REPO ) -j1
58
58
rm -rf www/css
59
59
ln -s ../static/css www
60
- learn-ocaml serve
60
+ LEARNOCAML_SERVER_NOCACHE=1 learn-ocaml serve
61
61
62
62
docker-images : Dockerfile learn-ocaml.opam
63
63
@rm -rf docker
Original file line number Diff line number Diff line change @@ -86,7 +86,14 @@ type 'a response =
86
86
87
87
type error = (Cohttp.Code .status_code * string )
88
88
89
- let caching: type resp. resp Api. request -> caching = function
89
+ let disable_cache =
90
+ match Sys. getenv_opt " LEARNOCAML_SERVER_NOCACHE" with
91
+ | None | Some ("" | "0" | "false" ) -> false
92
+ | Some _ -> true
93
+
94
+ let caching: type resp. resp Api. request -> caching = fun resp ->
95
+ if disable_cache then Nocache else
96
+ match resp with
90
97
| Api. Version () -> Shortcache (Some [" version" ; " server_id" ])
91
98
| Api. Static ("fonts" ::_ | "icons" ::_ | "js" ::_ ::_ ::_ as p ) -> Longcache p
92
99
| Api. Static ("css" ::_ | "js" ::_ | _ as p ) -> Shortcache (Some p)
You can’t perform that action at this time.
0 commit comments