StencilCache Sample: Uses the ATL Server Stencil Cache
Demonstrates how to use the stencil cache service in an ATL Server Web application.
The StencilCache sample illustrates how to:
Get and set the lifetime of the cache entries.
Use the statistics provided by the cache service.
The sample demonstrates the behavior of the stencil cache (also called the server response file cache) by writing a server response file to disk and changing it whenever the Touch button is clicked. This file is returned as part of the frameset displayed in the sample so that the cache is exercised. The statistics related to the cache are displayed in another page in the frameset.
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.
Building and Running the Sample
To build and run this sample
Open the solution file, SCSample.sln, in the Visual Studio development environment.
Build the solution. This will also deploy the solution to the local Web server.
Use a Web browser to view http://localhost/scsample/scsample.htm. Use the buttons on the page to test server response file caching.
CHttpResponse::SetContentType | CHttpResponse::AppendCookie | CHttpRequest::Cookies | CCookie::GetValue | IServiceProvider::QueryService | IMemoryCacheStats Class | IMemoryCacheStats::GetMissCount | IMemoryCacheStats::GetHitCount | IMemoryCacheStats::GetCurrentAllocSize | IMemoryCacheStats::GetMaxAllocSize | IMemoryCacheStats::GetCurrentEntryCount | IMemoryCacheStats::GetMaxEntryCount | IStencilCache | IStencilCacheControl | IStencilCacheControl::GetDefaultLifeSpan | IStencilCacheControl::SetDefaultLifeSpan