9

We have implemented DD4T (1.31) with Java Spring MVC.

We are facing a problem while making any changes to content. After publishing modified content, the application is not picking up new content from broker. It looks like it's cached somewhere as an application restart in Tomcat fetches new content.

I knew about Tridion's out of the box Cache Channel Service, but I recall the cache invalidates itself when a component is published after making changes.

6

DD4T has built in caching also.

For DD4T Java 1.31, I think you have to alter your dispatcher-servlet.xml to use the NoCacheProvider but I've never done it myself. See comments about caching in the example site here: https://code.google.com/p/dynamic-delivery-4-tridion/source/browse/trunk/java/dd4t-example-site/WebContent/WEB-INF/dispatcher-servlet.xml

I think if you alter this line:

<bean id="cacheProvider" class="org.dd4t.providers.impl.BrokerCacheProvider" />

To use this class: https://code.google.com/p/dynamic-delivery-4-tridion/source/browse/trunk/java/dd4t-providers/src/main/java/org/dd4t/providers/impl/NoCacheProvider.java

You should be good.

For DD4T Java 2.0 settings check the dd4t.properties file

cache.dependency.ttl = 3600
cache.expired.ttl = 600
cache.ttl = 60
monitor.service.interval = 60
  • Thanks for solution but the solution you suggested is to stop using Caching. So how can we invalidate the cache in case of any content is update in broker. I know Cache Channel Service is used to provided notification of chnages but hot we can consume these in dd4t app to invalidate cache. – Harish Sharma Dec 11 '15 at 14:23
3

We have faced the same type of issue previously and it was because of the built in caching property of DD4T. As Rob already suggested the solution. I am just adding an additional way to handle this situation. In our project we have created a controller class in Java and add it into our project.

That controller is used to manually invalidate the DD4T and its dependency cache. You can find the source code here. You can incorporate this feature in your project as well.

Every time you have to just run this controller from browser and it will invalidate all your 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.