Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2005

Tip: Looking for answers? Try searching our database.

URL Rewriting breaking Output Caching

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
R-D-C - 29 Mar 2005 13:59 GMT
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?
Brock Allen - 29 Mar 2005 18:27 GMT
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?
>
[quoted text clipped - 9 lines]
>
> Can anyone shed any light?
R-D-C - 01 Apr 2005 00:15 GMT
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?Language=English&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.

> 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
[quoted text clipped - 19 lines]
>>
>> Can anyone shed any light?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.