From: Stefano Zacchiroli Date: Tue, 7 Jan 2003 17:06:55 +0000 (+0000) Subject: - added some cache-control header telling not to cache some responses X-Git-Tag: v0_3_99~80 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=1e34c17c30ee6c992f3759bd0f0d5012e6803092;p=helm.git - added some cache-control header telling not to cache some responses --- diff --git a/helm/http_getter/http_getter.ml b/helm/http_getter/http_getter.ml index 1e04ae878..982544bce 100644 --- a/helm/http_getter/http_getter.ml +++ b/helm/http_getter/http_getter.ml @@ -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,