?
Solved

Caching for master page

Posted on 2009-04-29
4
Medium Priority
?
754 Views
Last Modified: 2012-05-06
Dear experts,

I m implementing a cms site.  I have used master page with place holders to implement template. User controls are loaded on the master page depending on the data provided on the database.

I m just worried about the performance of the site since everything is loaded at runtime.
How can i implement cahching on master page level to improve performance.

Regards
Bedanand
0
Comment
Question by:bedanand
  • 2
3 Comments
 
LVL 9

Expert Comment

by:Deathrace
ID: 24258361
hei,
you cannot add output cache directive to master page, you need to set it programmatically.
in the Page_Load use some thing like this



protected void Page_Load(object sender, EventArgs e)
{
    Response.Cache.SetExpires(DateTime.Now.AddMonths(1));
    Response.Cache.SetCacheability(HttpCacheability.ServerAndPrivate);
    Response.Cache.SetValidUntilExpires(true);
}

Open in new window

0
 
LVL 8

Author Comment

by:bedanand
ID: 24270785
How can i set the cache for the varing querystrings values and varing session values?

0
 
LVL 9

Accepted Solution

by:
Deathrace earned 2000 total points
ID: 24312382
you can go a head and use simple data caching for session values... hope the below link helps you.
http://www.softsteel.co.uk/tutorials/AspNetCaching/index.html
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question