Reputation: 817
I have been trying to get my PivotViewer implementation to NOT cache the HttpResponse but have not been successful. How does one set the expiration of a Response object? I have been doing the following.
_HttpContext.Response.Expires = 0;
_HttpContext.Response.ExpiresAbsolute = DateTime.Now.Subtract( new TimeSpan( 1, 0, 0, 0 ) );
_HttpContext.Response.CacheControl = "no-cache";
The problem is - subsequent call to display my PivotViewer always display the results of the first call. I am not using a static CXML - I am using the PivotServer tools and creating it dynamically.
What I want to know is how to set the expiry of the page so that each Pivot View request creates a HttpResponse or has the PivotViewer got a bug in it and it is ignoring cache control?
Upvotes: 0
Views: 217
Reputation: 865
I am assuming that you are making multiple LoadCollection() calls to the same URL and wondering why you are not getting a refresh, correct? If that's not the case then I misunderstood.
The PivotViewer will not make a new call if the Uri string passed in the LoadCollection() is identical to the previous call. Even adding a hash tag will not trick it. I'm not sure if this is a performance thing or what, but it is what it is. The only real way to reload the collection is to change the Uri. I typically do this by adding/modifying a querystring counter.
I have an example of this in a blog post : Reloading a Collection in PivotViewer
If you are having a different problem please let me know and we can get you fixed up.
Upvotes: 1