I believe that once you have got the 'member' object back, accessing the properties should be cached - or maybe at least only the first time you access a property it will hit the database and subsequent usage would be from the cache (as in the object itself).
Which version of Umbraco are you using? In earlier versions (e.g. v4.x and earlier), it did do a direct database call per property, but I believe that was changed in v6+.
It should initialise all the properties when GetCurrentMember is first called.
Accessing member properties (cached)
Hi
Every time I access member properties (vial getProperty("").Value) it results in a database call.
Before I go ahead and cache the member myself is there a way to access the member properties in Umbraco without database calls?
Thanks
Kev
Hi Kevin,
I believe that once you have got the 'member' object back, accessing the properties should be cached - or maybe at least only the first time you access a property it will hit the database and subsequent usage would be from the cache (as in the object itself).
Hope this helps?
Cheers,
- Lee
Hi Lee
I have a partial view that is accessing the properties, it is retrieving the member via:
But each time I call the getProperty().Value the debug-trace is showing the same SQL fired with each request.
Am I doing something wrong?
Thanks
Kev
Hi Kev,
Which version of Umbraco are you using? In earlier versions (e.g. v4.x and earlier), it did do a direct database call per property, but I believe that was changed in v6+.
It should initialise all the properties when
GetCurrentMember
is first called.Cheers,
- Lee
Hi Lee
It's v6.1.6.
Kev
is working on a reply...