Calling PartCacheRead works sometimes, other times not

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have a web part that is calling PartCacheRead and PartCacheWrite to cache
some data. I am using Storage.Shared in the call. I am using MOSS 2007.

If I add the web part to a subsite, the web part works fine. It puts data
in the cache and pulls it out, no problem.

But if I add the web part to the MOSS portal home page (which uses the
Publishing feature, if that matters), the call to PartCacheRead always
returns a null.

It makes no sense. As a test, I even changed RenderWebPart() to call
PartCacheWrite to put some data in the cache (which does not return an
error), then immediately call PartCacheRead to get it back out - no dice -
it returns null.

I drop the same web part on another page and it works fine.

Any clues as to why?


.



Relevant Pages

  • Re: PartCache Randomly Invalidating
    ... Cache isn't guarenteed to be present for the time you specify. ... Microsoft MVP Server-Networking ... > I am using PartCacheRead and PartCacheWrite. ...
    (microsoft.public.sharepoint.portalserver.development)
  • web part cache across pages
    ... have it available in the query string. ... using the web part cache, but I can't get it to work across pages. ... when I redirect, the cache is then gone, and PartCacheRead() pulls null ... Prev by Date: ...
    (microsoft.public.sharepoint.portalserver.development)