Language

[How Do I:] Cache an ASP.NET Page Based Upon Information in the HTTP Header

By |12 minutes|
In this video Chris Pels shows how to keep a page in the ASP.NET output cache based upon information in the page’s HTTP header. First, the potential HTTP header values are reviewed. Then, a sample page is created and then the OutputCache directive is used with the VaryByHeader attribute which contains a value “accept-language”, an HTTP header, to control caching based upon the language of the user’s browser. The sample page is viewed in IE which is set to English and then in FireFox which is set to use French. Finally, the option to move the cache definition to a CacheProfile in the web.config file is discussed.

DOWNLOADS: Code (C#)|Code (VB)|MP3|MP4|WMV

Chris Pels

By Chris Pels, Chris has been instrumental in the architecture, development, and implementation of a wide variety of business systems and databases as a technology consultant since 1986. He has extensive experience in business analysis, technical specifications, database design, several programming languages including C# and VB.NET, and statistical analysis. He holds a Ph.D. from The University of Michigan and has been a speaker at Microsoft TechEd, Microsoft DevDays, VSLive, numerous events in New England

Table of Contents

How Do I?

Tailspin Spyworks

Building 3.5 Applications

Authentication

SQL 2005

VS 2005

Migrating

Building 2.0 Applications

IIS

Visual Studio 2010

Ajax Control Toolkit

ASP.NET AJAX

Data Access

ASP.NET Dynamic Data

ASP.NET 3.5

jQuery

.NET 4

ASP.NET Web Forms vNext

ASP.NET vNext

Visual Studio vNext

Pluralsight Introduction to ASP.NET 4 WebForms