We have a tridion DXA 2.1 .NET website that is using Output Caching and View Model caching. Is there a way to invalidate the Output Cache and View Model cache based on some dependencies like some publish action by content author or so?

For example, in one of our site (not on DXA), navigation cache is invalidated once content author publishes sitemap.xml file. Here it is using standard dotnet file dependency. Is there something similar in DXA?

2 Answers 2


I am not sure if we have any such functionality out of the box in DXA 2.1, but there is a way to do this. We implemented this and the requirement was the same , whenever we publish a page, cache should be purged , you need to write your own custom logic to implement this.


  • Thanks for the reply and information. I read the link that you shared. Please help me understand what actions are performed by "localhost:92"+page.getURLPath()+"?ClearCache=true " URL? I see that this URL is clearing the cache , but is the code executing at this url is custom code or provided by Tridion? If it is custom code, then how do you access the website cache in localhost:92 website as I think it is a different app domain.
    – Rites
    Commented Jan 3, 2020 at 20:53
  • Yes, this URL clears the cache and ClearCache=true triggers the custom logic. PageMetaData will give the relative URL of the page and You need to maintain the domain in the config and get the value based on the target from the config to create absolute URL. "the sample code is of local dev env."
    – Hem Kant
    Commented Jan 4, 2020 at 13:37

As HemKant has suggested, you need to write down custom logic to achieve this as DXA do not have any out of box functionality.

Your Answer

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

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