Pro Cache Usage
-
good practices to use a memcached client to make your site faster!
public IEnumerable<Product> GetProductList()
{
List<Product> data = null;
var key = string.Format("{0}", "Some_Beautiful_Key");
if (_cache != null)
if (_cache.Contains(key))
data = _cache.Get< List >(key);
data = TheDao.GetProductTable();
if (_cache != null)
_cache.SaveOrUpdate(key, data);return data;
}
Rudy Alvarez // rdebug.com
-
good practices to use a memcached client to make your site faster!
public IEnumerable<Product> GetProductList()
{
List<Product> data = null;
var key = string.Format("{0}", "Some_Beautiful_Key");
if (_cache != null)
if (_cache.Contains(key))
data = _cache.Get< List >(key);
data = TheDao.GetProductTable();
if (_cache != null)
_cache.SaveOrUpdate(key, data);return data;
}
Rudy Alvarez // rdebug.com
-
good practices to use a memcached client to make your site faster!
public IEnumerable<Product> GetProductList()
{
List<Product> data = null;
var key = string.Format("{0}", "Some_Beautiful_Key");
if (_cache != null)
if (_cache.Contains(key))
data = _cache.Get< List >(key);
data = TheDao.GetProductTable();
if (_cache != null)
_cache.SaveOrUpdate(key, data);return data;
}
Rudy Alvarez // rdebug.com
When you already omit the {curly brackets}, you should not hesitate and do the next step: omit indentation, or better use random indentation.
public IEnumerable<Product> GetProductList()
{
List<Product> data = null;
var key = string.Format("{0}", "Some_Beautiful_Key");
if (_cache != null)
if (_cache.Contains(key)) data = _cache.Get<List<Product>>(key);
data = TheDao.GetProductTable();
if (_cache != null) _cache.SaveOrUpdate(key, data);
return data;
}And such features will be even harder to spot for the guys who have to fix your code.
-
When you already omit the {curly brackets}, you should not hesitate and do the next step: omit indentation, or better use random indentation.
public IEnumerable<Product> GetProductList()
{
List<Product> data = null;
var key = string.Format("{0}", "Some_Beautiful_Key");
if (_cache != null)
if (_cache.Contains(key)) data = _cache.Get<List<Product>>(key);
data = TheDao.GetProductTable();
if (_cache != null) _cache.SaveOrUpdate(key, data);
return data;
}And such features will be even harder to spot for the guys who have to fix your code.
-
When you already omit the {curly brackets}, you should not hesitate and do the next step: omit indentation, or better use random indentation.
public IEnumerable<Product> GetProductList()
{
List<Product> data = null;
var key = string.Format("{0}", "Some_Beautiful_Key");
if (_cache != null)
if (_cache.Contains(key)) data = _cache.Get<List<Product>>(key);
data = TheDao.GetProductTable();
if (_cache != null) _cache.SaveOrUpdate(key, data);
return data;
}And such features will be even harder to spot for the guys who have to fix your code.
I'm the guy that fix code :'( jajajaja