From 60a8c59b7d64febec242181309ecff51e074cc0a Mon Sep 17 00:00:00 2001 From: lukeIam Date: Sun, 1 Dec 2013 23:19:07 +0100 Subject: [PATCH] Webserver: -mod: also use cacheing headers for other resources --- ClientServerLib/ClientServerLib/CWebservice.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ClientServerLib/ClientServerLib/CWebservice.cs b/ClientServerLib/ClientServerLib/CWebservice.cs index d910dc6d..c0a28811 100644 --- a/ClientServerLib/ClientServerLib/CWebservice.cs +++ b/ClientServerLib/ClientServerLib/CWebservice.cs @@ -177,6 +177,10 @@ namespace ServerLib if (WebOperationContext.Current != null) { WebOperationContext.Current.OutgoingResponse.ContentType = "text/javascript"; + WebOperationContext.Current.OutgoingResponse.LastModified = DateTime.UtcNow; + WebOperationContext.Current.OutgoingResponse.Headers.Add( + HttpResponseHeader.Expires, + DateTime.UtcNow.AddHours(4).ToString("r")); } byte[] data = CServer.GetSiteFile("js/" + filename); @@ -198,6 +202,10 @@ namespace ServerLib if (WebOperationContext.Current != null) { WebOperationContext.Current.OutgoingResponse.ContentType = "text/css"; + WebOperationContext.Current.OutgoingResponse.LastModified = DateTime.UtcNow; + WebOperationContext.Current.OutgoingResponse.Headers.Add( + HttpResponseHeader.Expires, + DateTime.UtcNow.AddHours(4).ToString("r")); } byte[] data = CServer.GetSiteFile("css/" + filename);