开发者

ASP.net Cache overuse?

开发者 https://www.devze.com 2023-02-09 12:11 出处:网络
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 goodto cache this query in server memory as this SELECT against indexed

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 开发者_如何学Pythonand 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消