Master Page Cache

F

Fred Nelson

I have a question regarding page caching in a C# Web App that I'm
developing.

I have used page caching successfully in VS2003 at the page level - and
it also works the same in VS2005.

I have noticed that I can't cache master pages. I can cache individual
pages as before, however it appears that the server is building the
master pages for "non cached" pages each time. (I have proved this by
putting a date.time.now display on the master page and it is always
updated with each display).

Is there a way to cache the master page content so it can be used
repeatedly without having to be rebuild each time.

I would definately appreciate any help you can give me!

Thanks, Fred
 
G

Guest

Fred,
I really doubt you could do this and you probably would not even want to.

The concept of a Master Page is that it holds common elements, menu, etc.
that are used by each page that targets the .master file as its master page.

In other words, there is no "master page" to cache - because each page that
is requested using that Master Page contains all the elements of the master
page in it.
Hope that makes sense.

Peter
-
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
 
J

John Bailey

I disagree about not wanting to do this. The master page can be referenced in code, and it is similar to a web user control. Just like you want to cache web user controls, you definitely would want to cache a master page. There is a master page control to cache, it just doesn't support caching.

As an example lets take a mster page that has a header, a footer, and a side bar with that displays the latest forum entries. If you implemented this in .Net 1.1 you would implement each as a control, and you would cache the forum control. In a master page you might be tempted to put these in the master, but now how do you cache the forum information.

The master page unfortunately does not support caching, so this control is built with each page request. Any content on the master that needs to be cached should be built with user controls

From http://www.developmentnow.com/g/36_2006_1_0_0_666856/Master-Page-Cache.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top