Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the Tridion Core Service be notified of data changes?

Tags:

tridion

I'm implementing a Core Service "Facade" for some lazy programmers that don't want to change their coding style (me included), and wanted to implement object cache, which obviously leads to the grand question of "how long and how much should I cache".

The ideal answer is to cache forever except when data is changed.

Is there a way (via some WCF event perhaps) to implement a "listener" for data changes that could be used to remove items from their cache?

BTW, I am using .NET's native ObjectCache (MemoryCache) with a 1 minute sliding cache policy for now.

Thanks,

N

like image 387
Nuno Linhares Avatar asked Jul 29 '12 13:07

Nuno Linhares


1 Answers

There is no such system built-into either WCF or Tridion that I know of.

You could of course roll your own, where you:

  1. Listen for changes to the relevant data on the TCM server with Event Handlers
  2. Have those event handlers forward the event to a central notification server
  3. Have your WCF clients register with that notification server when they start up
  4. Have notification server subsequently send the notifications on to the connected clients

This is essentially quite similar to how Tridion's Broker Object Cache works on the Content Delivery tier.

If you're interested in implementing such an approach, I'd suggest having a look at the Signalr project, which takes a lot of the hassle out of it.


Edit: it turns out WCF has something akin to what you're asking for called Callbacks. See this question and this blog post.

like image 167
Frank van Puffelen Avatar answered Nov 01 '22 21:11

Frank van Puffelen