RavenDB, I love it’s aggressive caching. But be careful.

ASP.NET MVC,RavenDB 30 November 2011 | 0 Comments

In my earlier “RavenDB, I love it’s aggressive caching.” post, I made a fatal mistake in my coding for the caching scenario, I forgot about stale indexes.

Today I pushed an update to our “beta” environment for the website to let the client see the progress of the rewrite to a new theme, features and RavenDB.

I was greeted with a blank “testimonials” widget (it will load good things the client’s customers have said).

Oh man, what’s gone wrong.

It appears that when it was cached, the index was stale and must have returned no results.

I waited 5 minutes, the time which I had set it to be cached for and it fetched the actual results.

Lesson of this story, caching is great but make sure not to cache nothing, now to figure out how to fix this from happening again.

Leave a Reply