Caching for master page

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
LVL 8
bedanandAsked:
Who is Participating?
 
DeathraceCommented:
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
 
DeathraceCommented:
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
 
bedanandAuthor Commented:
How can i set the cache for the varing querystrings values and varing session values?

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.