M
moondaddy
I've made the decision to use search engine friendly URLs in my site which
means translating stripping all parameters our of the URL and converting it
to a hierarchical URL like this:
Change:
/mysite/default.aspx?MenuID=contactus
To:
/mysite/ContactUs.aspx?
The problem I'm having is that its really slowed things up by at least 0.5
seconds to 1 second longer just to pull up a light weight static page. The
then when navigating using the browser's back button, when I used the normal
(parameter urls) it navigates back instantly, but not its got that long
delay to translate the url. In short here's my code:
'Get the incoming hierarchical URL here.
Dim oldpath As String = context.Request.Path.ToLower()
'more code here to....
'Parse the page name out of the url and pass it to the default page as a
parameter.
'The default page will then run logic against this, query the db and
populate a user control in the content section of the default page with
dynamic content from the db.
context.RewritePath("default.aspx?MenuID=" & sPage)
This is the slow way to do it.
The fast way was just to pass url like this:
default.aspx?MenuID=123
Evidently the holdup is in the context.RewritePath.
This line of code is many times slower than executing 100s of lines of
normal code including hitting the db several times. Is there a way to speed
this up. Also, what considerations do I need to take into account when I'm
caching pages on the client, and/or caching pages on the server?
Thanks.
means translating stripping all parameters our of the URL and converting it
to a hierarchical URL like this:
Change:
/mysite/default.aspx?MenuID=contactus
To:
/mysite/ContactUs.aspx?
The problem I'm having is that its really slowed things up by at least 0.5
seconds to 1 second longer just to pull up a light weight static page. The
then when navigating using the browser's back button, when I used the normal
(parameter urls) it navigates back instantly, but not its got that long
delay to translate the url. In short here's my code:
'Get the incoming hierarchical URL here.
Dim oldpath As String = context.Request.Path.ToLower()
'more code here to....
'Parse the page name out of the url and pass it to the default page as a
parameter.
'The default page will then run logic against this, query the db and
populate a user control in the content section of the default page with
dynamic content from the db.
context.RewritePath("default.aspx?MenuID=" & sPage)
This is the slow way to do it.
The fast way was just to pass url like this:
default.aspx?MenuID=123
Evidently the holdup is in the context.RewritePath.
This line of code is many times slower than executing 100s of lines of
normal code including hitting the db several times. Is there a way to speed
this up. Also, what considerations do I need to take into account when I'm
caching pages on the client, and/or caching pages on the server?
Thanks.