By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,953 Members | 1,131 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,953 IT Pros & Developers. It's quick & easy.

caching different versions of page

P: n/a
I have a site where I have only one page and lots of user controls. Rather
than passing parameters into the page (mysite/default.aspx?MenuID=123), I
pass in a url like this (mysite/products-greenwidgets.aspx). then in the
global.asax I intercept the url coming in and convert it to a parameter url
like this (mysite/default.aspx?MenuID=greenwidgets). then when the
default.aspx page loads, it passes "greenwidgets" to the database and gets a
product listing for the category of "greenwidgets". I could just as easily
pass a parameter like "home" where it would then put the home page user
control into the content section of default.aspx instead of the
productlisting user control.

OK, all that being said, can I cache each version of the page on the server,
then in the global.asax intercept the incoming url and return the proper
cached version of default.aspx. It seems that if I could do this a lot
steps would be saved and it would run much faster.

--
mo*******@nospam.com
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

Thanks for posting. According to your description, you would like to know
whether URL rewriting in "global.ascx" works with page caching based on
parameter. If I have misunderstood you, please correct me.

The answer to this question is yes. Page output caching occurs at the page
level, with the internal path. Consequently, as long as the internal path
to the page (and its querry string) is consistent, page caching is in
effect.

If you have any further concerns regarding this, please feel free to post
here.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #2

P: n/a
OK, now that I know I can cache different versions of this page on the
server for all browser's hitting the url, how is this effected by situations
where:

When a user comes into the site, we start tracking their session by caching
the session variable on the server. They could also have a status of
"Logged In" or "Logged Out" showing in the header of all pages. Because
their login status and session information is unique to them, will this
prevent them from being able to use cached pages? There's only one page in
the whole site and it's default.aspx. However, there are many different
versions of default.aspx depending on the url and/or parameter being passed
back to the server. They will have certain personal information such as
login status showing on this page no matter which version of default.aspx is
being used.

how does this effect the use of pages cached on the server?

--
mo*******@nospam.com
"Felix Wang" <v-*****@online.microsoft.com> wrote in message
news:YM**************@cpmsftngxa10.phx.gbl...
Hi,

Thanks for posting. According to your description, you would like to know
whether URL rewriting in "global.ascx" works with page caching based on
parameter. If I have misunderstood you, please correct me.

The answer to this question is yes. Page output caching occurs at the page
level, with the internal path. Consequently, as long as the internal path
to the page (and its querry string) is consistent, page caching is in
effect.

If you have any further concerns regarding this, please feel free to post
here.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #3

P: n/a
Hi,

I think we can use the VaryByParam and VaryByHeader attributes here.

Caching Multiple Versions of a Page
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconCachingMultipleVersionsOfPageOrControlOutput. asp

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.