From eb7d0e7e0daf3b11724f0d2df904002b7729e1cf Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Thu, 11 May 2006 06:05:50 +0000 Subject: [PATCH] force ie not to cache .xml files --- src/configfile.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/configfile.c b/src/configfile.c index cdfb7887..8770d9a8 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -88,12 +88,13 @@ static void config_content_type(WS_CONNINFO *pwsc, char *path); typedef struct tag_contenttypes { char *extension; char *contenttype; + int decache; } CONTENTTYPES; CONTENTTYPES config_default_types[] = { - { ".css", "text/css; charset=utf-8" }, - { ".txt", "text/plain; charset=utf-8" }, - { ".xml", "text/xml; charset=utf-8" }, + { ".css", "text/css; charset=utf-8", 0 }, + { ".txt", "text/plain; charset=utf-8", 0 }, + { ".xml", "text/xml; charset=utf-8", 1 }, { NULL, NULL } }; @@ -172,6 +173,11 @@ void config_content_type(WS_CONNINFO *pwsc, char *path) { if(pct->extension) { ws_addresponseheader(pwsc,"Content-Type",pct->contenttype); } + + if(pct->decache) { + ws_addresponseheader(pwsc,"Cache-Control","no-cache"); + ws_addresponseheader(pwsc,"Expires","-1"); + } } }