mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Prevent pages from being cached on the client for error messages
--HG-- branch : 1.x
This commit is contained in:
@@ -283,6 +283,12 @@ namespace Orchard.OutputCache.Filters
|
||||
|
||||
// ignore error results from cache
|
||||
if (filterContext.HttpContext.Response.StatusCode != (int)HttpStatusCode.OK) {
|
||||
|
||||
// Never cache non-200 responses.
|
||||
filterContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache);
|
||||
filterContext.HttpContext.Response.Cache.SetNoStore();
|
||||
filterContext.HttpContext.Response.Cache.SetMaxAge(new TimeSpan(0));
|
||||
|
||||
_filter = null;
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user