Output Cache problem on ViewEngine that use 2 separate view for 1 controller
Asked Answered
O

1

0

http://www.hanselman.com/blog/MixMobileWebSitesWithASPNETMVCAndTheMobileBrowserDefinitionFile.aspx

To the sake of simplicity, please try out this. Basically, I am trying to do the mobile view engine, but then i found out that I have outputcache, which will cache one of 2 view (PC view) and then when i tried to access through mobile, it automatic show PC view.

So is there anyway to avoid this problem while still keeping the outputcache?

Thanks

Overload answered 5/2, 2010 at 18:48 Comment(0)
A
1

Is your problem that out of the box variance from Outputcache (varibyparam, varybycostum, varybyquerystring) is not enough?

If you need a cache that has variance by some route value then this might help you.

http://blog.stevensanderson.com/2008/10/15/partial-output-caching-in-aspnet-mvc/

or this: http://blog.maartenballiauw.be/post/2008/06/Creating-an-ASPNET-MVC-OutputCache-ActionFilterAttribute.aspx

I havn't tried these solutions but maybe they get you started.

EDIT At the time I wrote this answer I thought that Outputcache has no varinace by route values. But it realy has. Each URL has its own cache entry.

Arana answered 5/2, 2010 at 19:11 Comment(2)
thanks for your links, i actually found out a way to solve the problem by using custom filterOverload
@DucDigital, please post your solution?Calesta

© 2022 - 2024 — McMap. All rights reserved.