force ie not to cache .xml files

This commit is contained in:
Ron Pedde 2006-05-11 06:05:50 +00:00
parent 08ddf8a24a
commit eb7d0e7e0d

View File

@ -88,12 +88,13 @@ static void config_content_type(WS_CONNINFO *pwsc, char *path);
typedef struct tag_contenttypes { typedef struct tag_contenttypes {
char *extension; char *extension;
char *contenttype; char *contenttype;
int decache;
} CONTENTTYPES; } CONTENTTYPES;
CONTENTTYPES config_default_types[] = { CONTENTTYPES config_default_types[] = {
{ ".css", "text/css; charset=utf-8" }, { ".css", "text/css; charset=utf-8", 0 },
{ ".txt", "text/plain; charset=utf-8" }, { ".txt", "text/plain; charset=utf-8", 0 },
{ ".xml", "text/xml; charset=utf-8" }, { ".xml", "text/xml; charset=utf-8", 1 },
{ NULL, NULL } { NULL, NULL }
}; };
@ -172,6 +173,11 @@ void config_content_type(WS_CONNINFO *pwsc, char *path) {
if(pct->extension) { if(pct->extension) {
ws_addresponseheader(pwsc,"Content-Type",pct->contenttype); ws_addresponseheader(pwsc,"Content-Type",pct->contenttype);
} }
if(pct->decache) {
ws_addresponseheader(pwsc,"Cache-Control","no-cache");
ws_addresponseheader(pwsc,"Expires","-1");
}
} }
} }