Exclude routing parameters in VaryByParam for Asp.Net 4

Posted by HasanGursoy on Stack Overflow See other posts from Stack Overflow or by HasanGursoy
Published on 2010-04-17T08:38:02Z Indexed on 2010/04/17 8:43 UTC
Read the original article Hit count: 366

I have a routing setting in my global.asax file:

routes.MapPageRoute("video-browse", "video/{id}/{title}/", "~/routeVideo.aspx");

My routeVideo.aspx page has caching setting:

<%@ OutputCache Duration="10" Location="ServerAndClient" VaryByParam="id" %>

But when I request http://localhost/video/6/example1 and http://localhost/video/6/example2 after this, the page is created again. So I think VaryByParam works for * but I only want compile when id changes. Is there a way to define routing parameters at VaryByParam?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-4.0