I have a multi hostname site, and i like to only load the meny once / hostname. In the macro cahce section you can choose, "By Page", "Cache Personalized" and set a duration. But i would like a third option - "By Hostname"...
If a Cahe by page we do a lot of roundtrips extra and fill upp more memory, if I do a cache for the whole thing, the difrent sites get the same menu.
How can I get this to work, can I extend the cache handling, without breaking core. Or do I need to handle this in my usercontrols.
I'm not sure that's feasible in Umbraco itself, but as a quick solution you can just create the second virtual site then set its root folder to the same as your original site and set up network bindings so that each site to handle requests for a particular host name. Actually, you will have stuff very similar to load balancing, but where each node is dedicated to its own host header. Since every site will have its own cache you will have per-hostname caching.
Another more advanced but complicated option could be creating a custom cache provider for ASP.NET that will separate stored cache items by the host header of the current request or probably some additional criteria. You can get sample of implementing a custom cache provider for example here: http://msdn.microsoft.com/en-us/magazine/gg650661.aspx
I haven't tried it on my own, actually, but at a quick glance into umbraco's sources it seems that there's nothing special about macro caching - it does use a usual HttpCache object to do it, so, in my opinion that's supposed to work well. Could your explain in bit more details what issue your got exactly?
Fiddled around a bit, and got it woking perfektly.
What happend if I was logged in admin on one host and updated the other the cache was not updated and vice versa. In umbracoSettings.Config I needed to set up the host/ip for distributed calls and set it to enabled
Thanx for pointing me in the right direction...
<distributedCall enable="true"> <!-- the id of the user who's making the calls --> <!-- needed for security, umbraco will automatically look up correct login and passwords --> <user>0</user> <servers> <!-- add ip number or hostname, make sure that it can be reached from all servers --> <!-- <server>127.0.0.1</server>--> <server>firstHost</server> <server>secondHost</server> </servers> </distributedCall>
Cache By Hostname
Hi,
A question regarding cache.
I have a multi hostname site, and i like to only load the meny once / hostname. In the macro cahce section you can choose, "By Page", "Cache Personalized" and set a duration. But i would like a third option - "By Hostname"...
If a Cahe by page we do a lot of roundtrips extra and fill upp more memory, if I do a cache for the whole thing, the difrent sites get the same menu.
How can I get this to work, can I extend the cache handling, without breaking core. Or do I need to handle this in my usercontrols.
Any point in the right direction would be nice.
/Jonathan
I'm not sure that's feasible in Umbraco itself, but as a quick solution you can just create the second virtual site then set its root folder to the same as your original site and set up network bindings so that each site to handle requests for a particular host name. Actually, you will have stuff very similar to load balancing, but where each node is dedicated to its own host header. Since every site will have its own cache you will have per-hostname caching.
Another more advanced but complicated option could be creating a custom cache provider for ASP.NET that will separate stored cache items by the host header of the current request or probably some additional criteria. You can get sample of implementing a custom cache provider for example here: http://msdn.microsoft.com/en-us/magazine/gg650661.aspx
Thanx Rnovoselov for your reply,
The first solution I have tested - Multiple sites in IIS pointing to the same physcal web, and then set manage host names in Umbraco...
But then I got issues with the Xml Cache for content when publishing.
Have you got that working, anything you could think of that I missed?
/Jonathan
I haven't tried it on my own, actually, but at a quick glance into umbraco's sources it seems that there's nothing special about macro caching - it does use a usual HttpCache object to do it, so, in my opinion that's supposed to work well. Could your explain in bit more details what issue your got exactly?
Hi again,
Fiddled around a bit, and got it woking perfektly.
What happend if I was logged in admin on one host and updated the other the cache was not updated and vice versa.
In umbracoSettings.Config I needed to set up the host/ip for distributed calls and set it to enabled
Thanx for pointing me in the right direction...
is working on a reply...