caching different versions of page

M

moondaddy

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.
 
F

Felix Wang

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.
 
M

moondaddy

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?
 

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