Re: Options for WebPart Caching
- From: Nikander and Margriet Bruggeman <news@xxxxxxxxxxx>
- Date: Mon, 11 Jul 2005 00:28:12 -0700
Hello Michael,
You're probably best of using web part caching. You can use it via the PartCacheWrite and PartCacheRead methods of the WebPart class. One of the arguments you can input is Storage.Personal, which caches per user, see example:
PartCacheWrite(Storage.Personal, "mykey", "myvalue", TimeSpan.FromMinutes(5));
You can write cache in either the database or the ASP.NET cache object using this method. Be aware of the fact that the total amount of allowed cache of Shared and Personal cache in database mode is limited to 2 MB.
Kind regards, Nikander & Margriet Bruggeman
I have a question about the best strategy for caching a web part. The web part in question walks the sites structure and obviously would encounter some performance issues with this. This iteration populates a DataTable that would not change frequently but varies per user. I don't think that storing it in the session would be the best option and am leaning towards putting it in the cache but am unsure as to whether cache the whole web part or just the DataTable. Any advise in this and how to cache per user would be appreciated.
Thanks,
Michael Fischer
.
- References:
- Options for WebPart Caching
- From: Michael
- Options for WebPart Caching
- Prev by Date: get new list id
- Next by Date: Re: ASP.NET web app in a web part
- Previous by thread: Options for WebPart Caching
- Next by thread: Help for WebParts
- Index(es):