Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 28, 2012 02:01 PM by d_nicola
Mar 18, 2009 05:55 AM|LINK
I am running a CRM/web host with multiple web sites.
Each site, obviously has different pages. I know inside the BuildSiteMap we're required to check if _root has any nodes already:
if (_root != null)
Here's my question...
Is persistency in _root's nodes across the entire IIS application, or, is it just per domain? Because, obviously, if I have aaa.com and bbb.com, both hosted on my server and a visitor first views aaa.com, then bbb.com, I don't want the persistency because the
sites and content will be different.
If _root's nodes are persistent, can you force _root to clear or not keep them in the cache? I know this would be taxing on the server to have to repeatedly query the database server, but what are my options.
Mar 18, 2009 09:35 AM|LINK
I've always assumed this is per application (ie per app domain, so the loaded asp.net process), although I'd need to check that [adds to ever increasing to do list]. I have several apps on the same IIS server, in the same app pool, using different providers.
Mar 19, 2009 03:26 AM|LINK
My problem would be its one IIS app pool, with one site, with what will be thousands of bindings, serving multiple actual hosts (sites).
My sitemapprovider is config'd to serve the menu/pages from a database based on the domain name in the request. Therefore, (and correct me if I'm wrong), I'm probably going to have to issue _root.ChildNodes.Clear() on every request.
However, I could prossibly store the menu in the session and then on the next request, read it from there if it exists. That way its persistent per session, but not across the entire app. If the user navigates to a different site (even if it too is hosted
on my server), the session is cleared.
What do you think?
Thanks so much,
Mar 19, 2009 09:24 AM|LINK
Ah right, a single website but multiple domains. In which case you have a problem with the current provider since it only caters for a single site. If you need a different menu/domain then you'll need a provider the inherits from SiteMapProvider, not StaticSiteMapProvider
and implements its own caching. I've done this for sample providers that have a separate menu per user or per culture; instead of storing the a single set of nodes, you store multiple sets and use some external criteria to determine which set of nodes to return
(this could, for example, be the site domain). It uses the Cache object to store the data so it's only read from the database once.
You can download the culture sample provider at
http://ipona.com/misc/CultureSitemap.zip. It doesn't have sql dependency built in, but that would be easy to add. And it needs thoroughly testing, but it should be a good starting point.
Nov 28, 2012 02:01 PM|LINK
This exactly what I was looking for! Unfortunely, the link you provided for your smaple project is no longer available. Would it be possible for you to send me a new link to this project of you can perhaps email it to me?
Thank you very much!