ASP.net Cache overuse?

211 Views Asked by At

In a web project I perform a SELECT SQL query against an Indexed column of a table with 10-15 rows.

I want to ask you if it's good to cache this query in server memory as this SELECT against indexed tables is light and fast and its not complex at all. I cache to memory many things around (4GB) and I don't want to cache simple queries like this.

My question is what is the performance impact of this query if there is any against fetching cached data.

1

There are 1 best solutions below

0
On BEST ANSWER

It seems to me that the amount of space this data would actually take up in the cache is so small as to be almost insignificant. If the total cache space is 4GB, how much of that can this query possibly take up? Let's make a massively conservative assumption and say its 1MB of space. 1MB is 0.025% of 4GB.

Also, You can use the CacheItemPriority to assign a low priority to this data when entering it into the .NET cache if you want to. ASP.NET CacheItemPriority