Better performance to Query the DB or Cache small result sets?

Posted by user169867 on Stack Overflow See other posts from Stack Overflow or by user169867
Published on 2011-03-14T08:01:26Z Indexed on 2011/03/14 8:10 UTC
Read the original article Hit count: 265

Filed under:
|

Say I need to populate 4 or 5 dropdowns w/ items from a database. Each drop down will have < 15 items in it. These items almost never change.

Now I could query the DB each time the page is accessed or I could grab the values from a custom class that would check to see if they already exist in ASP.Net's cache and only if they don't query the DB to update the cache.

It's trivial for me to write but I'm unsure if the performace would be better or not. I think it would be (although not likely anything huge).

What do you think?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc