]> matita.cs.unibo.it Git - helm.git/commitdiff
- added some cache-control header telling not to cache some responses
authorStefano Zacchiroli <zack@upsilon.cc>
Tue, 7 Jan 2003 17:06:55 +0000 (17:06 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Tue, 7 Jan 2003 17:06:55 +0000 (17:06 +0000)
helm/http_getter/http_getter.ml

index 1e04ae8789ac06bab757c1b45398d7947cc2a3c3..982544bce69e606545660e839f7d539b471fb7ac 100644 (file)
@@ -30,6 +30,14 @@ open Http_getter_types;;
 open Http_getter_debugger;;
 open Printf;;
 
+  (* constants *)
+
+let common_headers = [
+  "Cache-Control", "no-cache";
+  "Pragma", "no-cache";
+  "Expires", "0"
+]
+
   (* HTTP queries argument parsing *)
 
 let parse_enc (req: Http_types.request) =
@@ -88,6 +96,7 @@ let return_all_foo_uris map doctype filter outchan =
   *)
   Http_daemon.send_basic_headers ~code:200 outchan;
   Http_daemon.send_header "Content-Type" "text/xml" outchan;
+  Http_daemon.send_headers common_headers outchan;
   Http_daemon.send_CRLF outchan;
   output_string
     outchan
@@ -181,7 +190,8 @@ let return_ls =
             objs "")
         in
         Http_daemon.respond
-          ~headers:["Content-Type", "text/plain"] ~body outchan
+          ~headers:(("Content-Type", "text/plain") :: common_headers)
+         ~body outchan
     | Fmt_xml ->
         let body =
           sprintf
@@ -214,7 +224,8 @@ let return_ls =
               objs ""))
         in
         Http_daemon.respond
-          ~headers:["Content-Type", "text/xml"] ~body outchan
+          ~headers:(("Content-Type", "text/xml") :: common_headers)
+         ~body outchan
 in
 let (index_line_sep_RE, index_sep_RE, trailing_types_RE,
     heading_cic_RE, heading_theory_RE,