mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Initial state
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using System;
|
||||
using Microsoft.AspNet.Mvc.Filters;
|
||||
|
||||
namespace MusicStore.Infrastructure
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
|
||||
public sealed class NoCacheAttribute : ActionFilterAttribute
|
||||
{
|
||||
public override void OnResultExecuting(ResultExecutingContext context)
|
||||
{
|
||||
context.HttpContext.Response.Headers["Cache-Control"] = "no-cache, no-store, max-age=0";
|
||||
context.HttpContext.Response.Headers["Pragma"] = "no-cache";
|
||||
context.HttpContext.Response.Headers["Expires"] = "-1";
|
||||
|
||||
base.OnResultExecuting(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user