Okay. Like most sane people, I try to do most things without reading the manual first. So, I'm happily developing my SharePoint Portal web parts, and I'm storing data into the PartCache, using the following method. The method takes 4 values, Storage type, a cache key, the data, and a System.TimeSpan value, like so:
this.PartCacheWrite(Storage.Personal, "test", this.m_strvisibleCameras, new System.TimeSpan(30,0,0,0));
There are no overloads, so you have to pass the TimeSpan. Well, of course I assumed that the System.TimeSpan value was the time to live for the cache object. Right? That would make sense, if you've used other cached objects, like Page.Cache. But, I wanted the cache to live forever, so I went looking into the docs and guess what the TimeSpan is for? From the FM:
timeout A System.TimeSpan that specifies the period during which PartCacheWrite attempts to write a value.
Okay. Well, I'm SURE they had a great reason for requiring this value and not providing an overload. But all my code was giving the WebPart 30 days to attempt to write a value. Next time, I'll try to RTFM.
-Brendan
Posted
Wed, Dec 10 2003 6:31 AM
by
Brendan Tompkins