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

URL Rewriting breaking Output Caching

P: n/a
Can these two functions coexist?

We have a web site where the querystrings are removed using URL Rewriting.
Instead the page appears to be a html page with a long name (containing what
would be in the querystring).

I have tried switching on output caching and varying by a parameter and
using VaryByCustom but the caching simply does not work. Tested it by
adding the time to the bottom of the page and the time updates every time we
refresh the page, even though the timeout on the cache is 60 seconds.

Can anyone shed any light?
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
When do you do the Url Rewriting? In global.asax? What method/event? The
output cache gets involved in the HttpPipeline fairly early, so you'd need
to plan when to do the rewriting. I've not tested the two together, so I'm
not sure what the results would be. I'll flag this post so I can go do some
testing. Fun stuff :)

-Brock
DevelopMentor
http://staff.develop.com/ballen
Can these two functions coexist?

We have a web site where the querystrings are removed using URL
Rewriting. Instead the page appears to be a html page with a long name
(containing what would be in the querystring).

I have tried switching on output caching and varying by a parameter
and using VaryByCustom but the caching simply does not work. Tested
it by adding the time to the bottom of the page and the time updates
every time we refresh the page, even though the timeout on the cache
is 60 seconds.

Can anyone shed any light?


Nov 19 '05 #2

P: n/a
I do the easy version of URL Rewriting ;-)

Say I want to see a URL in the browser that looks like
http://www.thingy.co.uk/English.News.23 that maps to
http://www.thingy.co.uk/news.aspx?La...glish&Story=23.

In global.asax BeginRequest I change the path using
HttpContext.Current.RewritePath("news.aspx")

I pass the querystring too and add an extra item to the querystring to say
waht the original URL was. I then pick this out in the page and use
HttpContext.Current.RewritePath to change the path again for postbacks.

Following this, the caching all goes to pot.
"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:29**********************@msnews.microsoft.com ...
When do you do the Url Rewriting? In global.asax? What method/event? The
output cache gets involved in the HttpPipeline fairly early, so you'd need
to plan when to do the rewriting. I've not tested the two together, so I'm
not sure what the results would be. I'll flag this post so I can go do
some testing. Fun stuff :)

-Brock
DevelopMentor
http://staff.develop.com/ballen
Can these two functions coexist?

We have a web site where the querystrings are removed using URL
Rewriting. Instead the page appears to be a html page with a long name
(containing what would be in the querystring).

I have tried switching on output caching and varying by a parameter
and using VaryByCustom but the caching simply does not work. Tested
it by adding the time to the bottom of the page and the time updates
every time we refresh the page, even though the timeout on the cache
is 60 seconds.

Can anyone shed any light?


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.