Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes, DB caching is part of best practice and can make very large performance gains. If you rely on it too heavily you can end up with very dispirit performance, say after the IIS worker has just restarted compared to once it has been running an hour.</p> <p>Remember to think about cache expiration, what if this popular content changes? How long before you uses see the new content? You get a lot of the performance boost for cache times a lot smaller then 24 hours, if you have a page view a second a cache time of 1 minute will save you 59 trips to the DB and mean if a page gets slashdoted you have a (small) chance of surviving.</p> <p>If you are using MS-SQL there are ways to <a href="http://msdn.microsoft.com/en-us/library/ms178604.aspx" rel="nofollow">invalidate caches</a> if a row or a table changes</p> <p>You may also want to investergate <a href="http://www.4guysfromrolla.com/articles/121306-1.aspx" rel="nofollow">output caching</a> if you are using ASP.NET, this allows you to cache the result from a page or a control, based on the URL parameters. This allows you to save web server CPU as well as DB load with your caching.</p> <p>try using <a href="http://msdn.microsoft.com/en-us/library/8bx0tk8a.aspx" rel="nofollow">System.Web.Cache</a></p> <pre><code>private MyContent GetContent(){ MyContent content = Cache[GetContentCacheKey()]; if(content == null) { content = GetContentFromDb(); Cache.Add(GetContentCaceKey(), content, null, DateTime.Now.AddHours(1), Cache.NoSlidingExpiration, CacheItemPriority.High, null); } return content; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload