How would you handle a situation when you want to cache some sublayout that relies on external data(search index, etc.)?
Here's the example:
- After updating content you click "Publish" in Sitecore.
- HTML cache is automatically cleared after publishing.
- Sublayout is rendered and put into the cache on first request, but the search index is not yet updated.
- Search index is updated.
- Until the next cache cleanup, sublayout will display the cached (obsolete) date.
Are there any simple ways to fix this issue?
I've got only one idea so far - trigger cache cleanup when the index update is over, but it might be complicated for many reasons.