We are using SDL Web 8.5 and DXA 2.0, after publishing content to live website we feel that content takes a long time to appear and sometimes it appears only after restarting the Content Service and Tomcat service. We have enabled all levels of caching and Tridion object caching using Apache ActiveMQ. We are using Linux server at Content Delivery side.
sometimes it appears only after restarting the Content Service and Tomcat service.
You may want to test this independently, so you can figure out which cache is holding your content updates hostage (as the solution is different depending on which).
You can test content updates on the Content Service by querying the service directly - check logs in debug to find examples of a query for a given page, then update content on that page, then try to retrieve it using the web service (or create a simple app that doesn't have DXA-level caching in it to get the content).
- If you don't see the content update, then your Content Service Cache invalidation is not working correctly. I would recommend reading this article by Velu on how to set this up properly.
- If you see the content update, then you know Content Service Caching is fine, and you can focus on DXA caching.
DXA has various types of caching levels, and they're all time based. You will have to discuss and agree with your business owners on what is an acceptable time to cache. On a busy site even a 30 second cache will make a huge difference, so don't be afraid to play around with this. In my experience, anything between 5 and 15 minutes is acceptable by the business, and this really depends on how often time-sensitive content updates are done.
I hope the above helps getting started on the wonderful journey of cache tuning.