Sign in
Google apps
Main menu
Post a Comment On:
Blogpad
"Cache Algorithm"
No comments yet. -
1 – 0 of 0
For an integer value:
private int GetInteger(int uniqueID)
{
int integerv;
string key = String.Format("{0}_{1}", "SOMETHING", uniqueID);
object value = Cache.Get(key); // could be HttpContext.Current.Cache.Get
if (value != null) {
integerv = (int)value;
}
else {
integerv = _db.GetValueFromDb(uniqueID);
Cache.Add(key, integerv); // could be HttpContext.Current.Cache.Add
}
return integerv;
}
posted by fc at
7:18 PM
on Jan 17, 2011
Leave your comment
You can use some HTML tags, such as
<b>, <i>, <a>
This blog does not allow anonymous comments.
Google Account
You will be asked to sign in after submitting your comment.
Please prove you're not a robot
"Cache Algorithm"
No comments yet. -