5

In the pipeline of my Template Builder, I have a Template Building Block which takes a Component as parameter. When I update this Component in Tridion then publish the Page that calls this TBB, I noticed the Page keeps serving outdated content. Like if the Component was being cached somewhere.

After some searches, I found out that it works if I restart the Tridion Publisher service after editing my Component and before publishing the Page again.

Since I don't want to restart this service every time I need to update this Component, I would like to know what really happens when I restart it. Is there a cache cleared somewhere?

7

The Publisher for sure caches objects, but the lifetime of that cache is normally from the point the the Publish Transaction is picked up from the queue to the point that rendering (of all items in the Publish Transaction) is done.

There is a possibility to configure a shorter lifetime (only during rendering of individual items) but this is normally not required and only results in worse performance.

It should never be needed to restart the publisher to clear the cache.

The problem might be in one of your Templates: Templates might cache data in static variables (you really should not do that, though!). The lifetime of static variables is the same as the lifetime of the Publisher Service, meaning that you indeed may have to restart the Publisher Service.

  • Thanks for those informations. Actually, the TBB i'm talking about loads a DLL. In the code of this dll, the component being passed as parameter is read and a page is built accordingly. Everytime i publish the page, the C# code is executed so i don't understand in what variables the data could be saved... – user1178 Mar 24 '17 at 10:54
  • 1
    The C# code can use static variables (internally). If that is the case, data stored in those variables will stay across calls and even when new objects are instantiated (static variables have the lifetime of the container type instead of the container instance). Types, in turn, have the lifetime of the App Domain (host process). – Rick Pannekoek Mar 24 '17 at 12:14

Your Answer

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