Skip to content

Instantly share code, notes, and snippets.

@cbilson
Created March 6, 2009 22:34
Show Gist options
  • Save cbilson/75103 to your computer and use it in GitHub Desktop.
Save cbilson/75103 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Castle.MonoRail.Framework;
using System.Collections;
using System.Reflection;
using Newtonsoft.Json;
using System.IO;
using System.Text;
namespace Ris.Fx.Web.Controllers {
public class NoCacheFilter : Filter {
protected override bool OnBeforeAction(IEngineContext context, IController controller, IControllerContext controllerContext) {
context.Response.CachePolicy.SetCacheability(HttpCacheability.NoCache);
return base.OnBeforeAction(context, controller, controllerContext);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Castle.MonoRail.Framework;
using System.Collections;
using System.Reflection;
using Newtonsoft.Json;
using System.IO;
using System.Text;
namespace Ris.Fx.Web.Controllers
{
[Rescue("RisRescue"),
Layout("RISPage"),
Filter(ExecuteWhen.BeforeAction, typeof(AppHealthFilter)),
Filter(ExecuteWhen.BeforeAction, typeof(NoCacheFilter))
/* or:
Cache(HttpCacheability.NoCache) */]
public class BaseController : SmartDispatcherController
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment