November Happy Hour will be moved to Thursday December 5th.

Cacheproblem - RemoveCachedObject

Vote:
 

Hi,
I have a cache-problem when getting blog-entries with queries (GetQueryResult)
I understood that i have to kill the cache manually on the save/update/delete-events, and i've tried following with no success:

// Add new blog entry SCBlog.Entry entry = new SCBlog.Entry(blog, AuthorHandler.GetUserAuthor(CurrentUser), TextBoxTitle.Text.Trim(), TextBoxContent.Text.Trim());                 entry.PublicationStart = DateTime.Now;                 entry = SCBlog.BlogHandler.AddEntry(entry); // Empty cache StarSuite.Core.Cache.CacheHandler.RemoveCachedObject(blog);

Could not find anything in the forum that helped me.
Thanks in advance,
/Dennie

#24728
Oct 06, 2008 15:35
Vote:
 

Hi Dennie!

Your problem is that you are removing the cache for the blog and not for the query. It's the cache for the actual query you want to remove.

To be able to use this functionality you have to be running version 3.1 of EPiServer Community. So first of all you maybe need to upgrade ;) Then take a look at the Programmer's Guide 3.1, section 2.6.4 "Remove Query Result Cache" where the details are described.

Also note that you only have to remove the cache in case of a save (or actually an "Add"), since the system will remove the caches automatically in case of update or delete.

//Tom

#24832
Oct 08, 2008 9:34
Vote:
 

Hi Tom,

thanks a lot for your time and help, it worked fine :)

QueryHandler.RemoveQueryResultCache();

/Dennie

#24849
Oct 08, 2008 11:36
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.