8

We have an application that uses DD4T and it saves few files to Broker DB.

We have observed under settings cd_storage.xml Object Cache is enabled(code below).

<ObjectCache Enabled="true">
    <Policy Type="LRU" Class="com.tridion.cache.LRUPolicy">
        <Param Name="MemSize" Value="32mb"/>
    </Policy>
    <Features>
        <Feature Type="DependencyTracker" Class="com.tridion.cache.DependencyTracker"/>
    </Features>
</ObjectCache>

But no object Cache service is running on server. Few days before we encountered issues with cache. Items that are modified and published are not appearing on site. We checked DB and found that items are saved in it. But App (website) is unable to fetch it. Also no Output Cache is set at IIS level.

My question is, could this configuration that we have at the delivery end, cause a cache issue.

8

(Copied from StackOverflow, by Bart's request)

How Tridion Content Delivery's Object Caching works

Any Tridion Content Delivery module that accesses the storage (through the Broker or Storage layer) has a built-in ability to cache the items it retrieves. That caching is enabled by the setting you show above ObjectCache enabled="true". So by simple setting that to true, you've enabled caching in any module that uses this configuration file.

The Tridion Content Delivery Cache (Channel) service does not do any of the actual caching. Instead it ensures that different modules of Tridion Content Delivery get notified of changes to the underlying data storage. It serves as a communication channel between the different modules and relays cache notification messages between them.

So if for example you have the Tridion Content Deployer and a Web Site running on a single (.NET) machine, then the Deployer may end up updating the database. The Deployer then notifies the Web Site by sending a message to it through the Cache service. So I typically think of it as the Cache Notification service.

Why your web site is serving outdated content

Knowing this, it makes sense that your web site is serving stale items. Its cache is enabled, but it is not being notified when something in the underlying data storage gets updated.

The solution is normally relatively simple:

  1. Run the Cache Notification service on one of your machines
  2. Enable the Remote Cache in the cd_storage on all Tridion modules
  3. Point them to the Cache Notification service (if that is running on a different machine)
11

Despite popular belief, the Cache Channel Service itself does not handle caching, it only handles propagation of what items should be taken out of the cache. The cache itself is part of the Broker and it is enabled or disabled in the storage conf.

The Cache Channel Service is there because the Deployer and Broker(s) can run in a separate memory space or JVM, and thus when new content is deployed, the Broker might not know what is is updated and that it needs to clear certain items from its cache. So the Deployer notifies through the Cache Channel Service (which basically send s a broadcast to which all Content Delivery services like the Broker are registered) that a certain item should be invalidated in the cache.

Now since you have caching enabled in your storage conf (which it should be on production/live environments, you should only ever turn it off for development or debugging), you should have a Cache Channel Service set up too, or else you will indeed encounter the situation you describe. New content is deployed, but the Broker still serves old content (from the cache).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.