Notification on index update

Vote:
 

Hi,

Is there anyway to get a notification when the find index has been updated. Something similar to the PublishedContent event?

Best regards Niklas

#175381
Feb 17, 2017 14:42
Vote:
 

Hi Niklas

Why do you need to know if the index has been updated? You can hook into the PublishedContent event for content and if you are custom indexing things yourself you can raise an event there? 

David

#175382
Feb 17, 2017 15:55
Vote:
 

Hi David,

If a cache is built with Find index as data source i imagine that the cache will need to be invalidated when the index is updated.

I cant see how PublishedContent will help with the invalidation. When PublishedContent is firing the Index isn´t updated yet. Right ?

Regards Niklas

#175384
Edited, Feb 17, 2017 16:41
Vote:
 

If you are using the default Find implementation the index should be updated automatically whenever you publish content (it uses PublishedContent under the hood).

If you are using GetContentResult() then the Find takes care of the caching for you as explained here: http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/8/Integration/EPiServer-75/GetContentResult-and-GetFilesResult/. If you are caching anything that depends on content then use the Episerver Cache manager and put a dependency on the master cache key. This will invalidate the cache as soon as any content changes on the site and also will invalidate across all running instances of the same site. 

EMVP Daniel Ovaska is a big caching fan and has written a number of great posts on caching in Episerver, for example: 

http://world.episerver.com/blogs/Daniel-Ovaska/Dates/2016/4/episerver-performancepart-3-object-cache-as-aop-with-interceptor/ 

http://world.episerver.com/blogs/Daniel-Ovaska/Dates/2016/5/making-a-cache-dependency-on-pagetype-and-ancestor/

David

#175386
Feb 17, 2017 16:54
Vote:
 

Thanks David.

I am doing some performance testing and I got confused. It turned out I was doing this on every test setup: "var findClient = Client.CreateFromConfig();". Which of course resets the built in cache you are talking about.

Regards Niklas

#175436
Feb 20, 2017 11:23
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.