Here at Stack Overflow, we try to use aggressive caching at many levels:
- pages fully cached by the IIS output cache, regardless of user authentication
- pages cached only for anonymous users; registered users see the latest content
- parts of the html page pages cached for all;
HttpRuntime.Cache used for this.
Homepage consists of three cached html elements - last questions, last tags, last icons - each with a different duration.
The question list page will cache the identifiers ( Int32[] ) of all questions for a particular sorting / tag filter, making paging trivial. Additional caching is also performed according to statistics (for example, the number of questions, counting related tags).
Page <detailed description < will be fully cached for anonymous users, and registered users will see the latest products. In addition, related issues on the side are cached to disk for a longer time.
While we are trying to cache entire pages, where possible, we show the user information on the page up - some parts simply cannot be cached.
So, look at caching as a puzzle - what parts can be safely distributed between all my requests? What parts MUST be shared in all of my requests?
Jarrod dixon
source share