Configuring, Optimizing, and Deploying A Microsoft
Configuring, Optimizing, and Deploying A Microsoft
Deploying a Microsoft
ASP.NET Web Application
Module 15: Configuring, Optimizing, and
Deploying a Microsoft ASP.NET Web Application
• Implementing the Cache Object
Cache("myKey") = myValue
Cache["myKey"] = myValue;
Advantages of Using the Cache Object
• Faster than creating a new object for each request
'Implicit method
Cache("myKey") = myValue
'Explicit method
Cache.Insert("myKey", myValue, Dependency, AbsoluteExpiration, _
SlidingExpiration, CacheItemPriority, CacheItemRemovedCallBack)
//Implicit method
Cache["myKey"] = myValue;
//Explicit method
Cache.Insert("myKey", myValue, Dependency, AbsoluteExpiration,
SlidingExpiration, CacheItemPriority, CacheItemRemovedCallBack);
• AbsoluteExpiration time
DateTime.Now.AddMinutes(5)
• SlidingExpiration time
TimeSpan.FromSeconds(20)
• Dependent on a changed value
AddCacheItemDependency("Variable.Value")
• Configuration Inheritance
• Web.config files
Application and directory-level settings
• Application-level
CONFIG
CONFIG Web.config file inherits
settings from
Machine.config file
Machine.config
• Settings in Web.config
VirtualDir
file that conflict
VirtualDir
override inherited
settings
Web.config
• Individual directories
may have Web.config
SubDir
SubDir files that inherit from—
and can override—
application-level
Web.config
settings
Demonstration: Configuration Inheritance
• Create a subfolder that contains a Web.config file
<configuration>
<appSettings>
<add key="pubs" value="server=localhost;
integrated security=true; database=pubs"/>
</appSettings>
</configuration>
Logon information
Virtual machine 2310C_15
User name Student
Password Pa$$w0rd
Logon Page
Login.aspx
Benefits
Coho Home Page Page Header ASPState
Winery Default.aspx Header.ascx
Menu
Registration Component
Register.aspx Class1.vb or Class1.cs Web.
tempdb
config
XML
Doctors Dentists
Files
Lab Review
Module Review and Takeaways
Review Questions
• What is the difference between the Cache object and page
output caching?
• What sort of caching would you use to place a DataSet
into cache?
• Which files can you use to configure an ASP.NET Web
application?
• What are the three main steps to deploying an ASP.NET
Web application?
• Why would you consider using dynamic properties to store
the URL to an XML Web service in Web.config?
Course Evaluation
Review for Alpha
• Is there any topic or specific content item in the module
that seemed unclear or unnecessary?
• Is there any content item/related subject area that was
not covered and could be included?
• Did you observe any issues with the technical accuracy of
the content?
• Is the content in the module presented in a manner that
encourages learning? Did the flow of topics seem right?
• Does the lab outline indicate the expected scope of tasks
to be covered? Would you like to suggest any tasks that
could be removed or added?