From b4aefad99d1fbf2f9db06e972699d6423005f06f Mon Sep 17 00:00:00 2001 From: inga-lovinde <52715130+inga-lovinde@users.noreply.github.com> Date: Sat, 12 Jun 2010 22:53:55 +0000 Subject: [PATCH] Cache headers for static content added --- Builder/IISMainHandler/build.txt | 2 +- IISMainHandler/handlers/StaticHandler.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Builder/IISMainHandler/build.txt b/Builder/IISMainHandler/build.txt index 147ea53..b000479 100644 --- a/Builder/IISMainHandler/build.txt +++ b/Builder/IISMainHandler/build.txt @@ -1 +1 @@ -158 \ No newline at end of file +159 \ No newline at end of file diff --git a/IISMainHandler/handlers/StaticHandler.cs b/IISMainHandler/handlers/StaticHandler.cs index 41a197f..4df06a5 100644 --- a/IISMainHandler/handlers/StaticHandler.cs +++ b/IISMainHandler/handlers/StaticHandler.cs @@ -46,6 +46,9 @@ namespace FLocal.IISHandler.handlers { throw new HttpException(403, "wrong file type"); } + context.httpresponse.CacheControl = HttpCacheability.Public.ToString(); + context.httpresponse.Expires = 1440; + context.httpresponse.WriteFile(fileinfo.FullName); }