MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

Caching in MOSS

  Asked By: Loren    Date: Sep 01    Category: MOSS    Views: 1104

I have a stock web part , which will pull the stock details from the web
service and will display the same in the portal .
I need to implement caching on this webpart. Can I ?

I have done the following steps to write a hello world webpart. But i
am getting error :- " incompatible web part markup detected. Use *.dwp
webpart xml instead of *.webpart webpart XML "

1) Inherit the web part from CacheableWebPart class ( Added ref to
Microsoft.Sharepoint.Portal )
2) Add this code to the beginning of the web part's RenderWebPart method:
if (RenderCachedOutput(ref HtwWriter))
3) Add this code to the end of the web part's RenderWebPart method:
StoreCachedOutput( ref HtwWriter );



1 Answer Found

Answer #1    Answered By: Deirdre Macias     Answered On: Sep 01

The CacheableWebPart class  is marked in the SDK for internal use only. That
means only Microsoft can use that particular class when writing code. I suspect
your problem is that the class requires some special markup in the .webpart or
.dwp file in order to work right. Since its an internal only class the
documentation on that topic is not provided.

Do you want to cache the HTML produced by the webpart  (that's what the cacheable
webpart does) or do you want to cache the results of the webservice  call? If
you just want to cache the data then make the web  part inherit  from
Microsoft.SharePoint.WebPartPages.WebPart and use the PartCacheRead and
PartCacheWrite methods of the web part  to cache the data. See the following for
more information.


Didn't find what you were looking for? Find more on Caching in MOSS Or get search suggestion and latest updates.