I'm preparing a demo and ran into this strange behavior.
I installed Umbraco with Runway and the runway topnavigation.
In the top navigation xslt I added some code to see when the navigation is rendered.
On the navigation macro i set the cache settings to :
Cache period : 3600
Cache by page : unchecked
Cache personalized : checked
When I call the page I see that the navigation is rendered every request. When a user logs in the macro gets cached. When I uncheck cache personalized I see that once rendered a cached version of the macro is rendered for all pages. The problem is that when a user logs in he can't see the protected pages.
Why doesn't umbraco cache the macro when I have cache personalized checked and there is no user logged in ?
Umbraco caches the personalisation per logged on member. Rather than caching for an anonymous user it skips the step entirely, I suppose it's not personalised if there is nobody logged in.
// do not add to cache if there's no member and it should cache by personalization
if (!CacheByPersonalization || (CacheByPersonalization && Member.GetCurrentMember() != null))
Have you tried ticking both cache by page and cache by personalized?
I can't imagine that a navigation macro should be so slow that it'll benefit much by caching, the only macro's we ever cache are those which hit the database [such as those which use getMedia()]
Weird macro cache behavior
I'm preparing a demo and ran into this strange behavior.
I installed Umbraco with Runway and the runway topnavigation.
In the top navigation xslt I added some code to see when the navigation is rendered.
On the navigation macro i set the cache settings to :
Cache period : 3600
Cache by page : unchecked
Cache personalized : checked
When I call the page I see that the navigation is rendered every request. When a user logs in the macro gets cached. When I uncheck cache personalized I see that once rendered a cached version of the macro is rendered for all pages. The problem is that when a user logs in he can't see the protected pages.
Why doesn't umbraco cache the macro when I have cache personalized checked and there is no user logged in ?
I think this is a bug so I created a codeplex workitem : http://umbraco.codeplex.com/workitem/29207
Please vote for this
Umbraco caches the personalisation per logged on member. Rather than caching for an anonymous user it skips the step entirely, I suppose it's not personalised if there is nobody logged in.
Have you tried ticking both cache by page and cache by personalized?
I can't imagine that a navigation macro should be so slow that it'll benefit much by caching, the only macro's we ever cache are those which hit the database [such as those which use getMedia()]
Ian,
I have tried all possible options.
But I think it the macro should cache if no user is logged in, even if cache personalized is checked. A public user is a user too
Hi dave, the link above to codeplex is broken. Can you reconnect it please?
Hi Robert,
The link above is more than 4 years old. Since then the Umbraco issue tracker has been moved to http://issues.umbraco.org/dashboard
is working on a reply...