This is a migrated thread and some comments may be shown as answers.

[Solved] OutputCache issue

1 Answer 27 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Christian Setzkorn
Top achievements
Rank 1
Christian Setzkorn asked on 14 Oct 2011, 08:42 AM
Hi,

I am trying to optimise my site and marked my actions with something like this:
[OutputCache(Duration=int.MaxValue, VaryByParam="none")]

My actions look like this:

[MembersOnlyAttribute]
        [GridAction]
        [Transaction]
        public ActionResult Index()
        {
            return View(CategoryRepository.GetCategories());
        }

When I use something like this:

[OutputCache(Duration=int.MaxValue, VaryByParam="none")]

The filter and sorting functions stop working (I am doing things server side via the telerik grid linq engine). Is this intended? Is there anything I can do to fix this? Thanks.

Christian

1 Answer, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 14 Oct 2011, 09:47 AM
Hello Christian Setzkorn,

The behavior you have described is expected. In this cache configuration the cached data will never be refresh until the duration expires, skipping the different request parameters. Therefore, in order to return different data when values of the request params vary you should either remove the  
VaryByParam or set it to "*".

Regards,
Rosen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
Christian Setzkorn
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or