Edit: (for ASP.NET MVC applications)
How about this:
Make the definition of OutputCache as follows:
<%@ OutputCache Duration="120" VaryByParam="None" VaryByCustom="listingtype;propertytype;location" %>
In Global.asax.cs add the following methods:
public override string GetVaryByCustomString(HttpContext context, string custom)
{
if (custom == "lisingtype")
{
return GetParamFromRouteData("listingtype", context);
}
if (custom == "propertytype")
{
return GetParamFromRouteData("propertytype", context);
}
if (custom == "location")
{
return GetParamFromRouteData("location", context);
}
return base.GetVaryByCustomString(context, custom);
}
private string GetParamFromRouteData(string routeDataKey, HttpContext context)
{
object value;
if (!context.Request.RequestContext.RouteData.Values.TryGetValue(routeDataKey, out value))
{
return null;
}
return value.ToString();
}
Old Content:
If you just put OutputCache in your action method and make all parts of your route part of your action, something like this:
[OutputCache]
public ActionResult FindProperties(string listingtype, string propertytype, string location)
{
}
(. http://aspalliance.com/2035_Announcing_ASPNET_MVC_3_Release_Candidate_2_.4)