3

At a customer we have trouble with urls that do not get updated. When a Page is moved up or down in the navigation (Structure Groups), the old URLs are still resolved (which causes 404's).

A custom URL resolver is used and I see that the ComponentLink object (Tridion.ContentDelivery.Web.Linking) is cached without any expiration time. That means it will only be created again after the application pool is recycled or website is restarted.

My question: if you cache the ComponentLink object, does that result in URLs not being updated when using the GetLink method?

UPDATE: interesting detail is that after recyclying the IIS App Pool of the application, the links are resolved correctly.

source code: enter image description here

enter image description here enter image description here

enter image description here

cd_storage_conf.xml:

I couldn't get the XML completely working in this post, so you find it here (Paste Bin). As you can see we publish to file system.

9
  • Can you share some more detail around the exact code you are using, i.e. edit your question and add a source code example of how you use and cache the ComponentLink object, together with the configuration of your Deployer and Cache Channel Service? Feb 22, 2017 at 9:39
  • I would investigate the cache channel service if you are using it. We have a hotfix for a similar issue on SDL Web 8 - never seen it in 2013 SP1 though. tridion.stackexchange.com/questions/16340/… so it sounds like something not configured correctly. Feb 23, 2017 at 13:59
  • Thank you for your replies. I will do some more research after my holidays ;) Feb 23, 2017 at 16:51
  • @RobStevenson-Leggett, I updated the post with more info. Mar 20, 2017 at 11:19
  • 1
    OK... so it looks like you have your own component link object caching - yes, I would expect that in this case your application never actually gets the link from Tridion CD, and instead will use that. Solution is simple though: add absolute expiration (not sliding) to your cache.Add instruction, maybe with a value of 10 minutes or whatever makes you feel comfortable.
    – Nuno Linhares
    Mar 20, 2017 at 11:23

1 Answer 1

2

You shouldn't cache these objects indefinitely, as then your web application will not get any updates (unless you restart IIS, as you mention).

So, the best (and fastest) way to achieve this would be to modify your implementation of cache to ensure it uses an "Absolute Expiration" model with perhaps a duration of 10 minutes (or whatever makes your editors comfortable).

It is worth stating that with a well configured cache layer (with a working Cache Channel Service) you can rely on Tridion cache to always provide you the latest information available and this removes the need to create your own cache. I would recommend using additional/custom cache for any queries you do on the front-end (keyword queries, schema queries, etc) as these tend to either be invalidated very often (keyword queries will be invalidated every time you publish any component) or not be cached at all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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