diff --git a/Teknik/Controllers/DefaultController.cs b/Teknik/Controllers/DefaultController.cs
index a620d53..245b261 100644
--- a/Teknik/Controllers/DefaultController.cs
+++ b/Teknik/Controllers/DefaultController.cs
@@ -75,26 +75,30 @@ namespace Teknik.Controllers
// Get the Favicon
[HttpGet]
[AllowAnonymous]
- [OutputCache(
- Duration = 31536000,
- Location = OutputCacheLocation.ServerAndClient)]
public ActionResult Favicon()
{
// Get favicon
string imageFile = Server.MapPath(Constants.FAVICON_PATH);
+
+ Response.Cache.SetCacheability(HttpCacheability.Public);
+ Response.Cache.SetMaxAge(new TimeSpan(365, 0, 0, 0));
+ Response.Cache.SetLastModified(System.IO.File.GetLastWriteTime(imageFile));
+
return File(imageFile, "image/x-icon");
}
// Get the Logo
[HttpGet]
[AllowAnonymous]
- [OutputCache(
- Duration = 31536000,
- Location = OutputCacheLocation.ServerAndClient)]
public ActionResult Logo()
{
// Get favicon
string imageFile = Server.MapPath(Constants.LOGO_PATH);
+
+ Response.Cache.SetCacheability(HttpCacheability.Public);
+ Response.Cache.SetMaxAge(new TimeSpan(365, 0, 0, 0));
+ Response.Cache.SetLastModified(System.IO.File.GetLastWriteTime(imageFile));
+
return File(imageFile, "image/svg+xml");
}
diff --git a/Teknik/Global.asax.cs b/Teknik/Global.asax.cs
index 4f166a2..55e8d5b 100644
--- a/Teknik/Global.asax.cs
+++ b/Teknik/Global.asax.cs
@@ -32,6 +32,8 @@ namespace Teknik
AntiForgeryConfig.RequireSsl = true;
+ MvcHandler.DisableMvcResponseHeader = true;
+
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
@@ -45,6 +47,12 @@ namespace Teknik
stopwatch.Start();
}
+ protected void Application_PreSendRequestHeaders(object sender, EventArgs e)
+ {
+ // Remove stupid headers
+ HttpContext.Current.Response.Headers.Remove("Server");
+ }
+
protected void Application_EndRequest(object sender, EventArgs e)
{
try
diff --git a/Teknik/Web.config b/Teknik/Web.config
index 7692517..e782add 100644
--- a/Teknik/Web.config
+++ b/Teknik/Web.config
@@ -47,7 +47,7 @@
-
+