Ultimately, the idea is to cache the content objects themselves. Which would mean that the content returned by the cache is global to
the entire application, and that the same content model object is
returned to all requests for as long as that content does not change.
Because that object is shared by requests, property values are
converted once, which is more efficient.
Which prompts rule number 1: content models must be stateless with
regards to the current request. If you add a property to a model, and
the value of that property depends on the current request, then you
must not store that value as a field. It must be re-calculated each
time, or stored in a cache at request's level.
And I have to admit, I'm not exactly sure what it's talking about. Is there somewhere where I can see an example to understand better?
Or If someone can explain what's the best practice here? Should I create View Models if I need something different than the content? Or am I missing the point?
Content Models Caching Question
Hello,
I'm playing with Models Builder since I have some free time and I'm looking into the best practices. I came across this:
Model Caching
long story short I want to ask about this:
And I have to admit, I'm not exactly sure what it's talking about. Is there somewhere where I can see an example to understand better?
Or If someone can explain what's the best practice here? Should I create View Models if I need something different than the content? Or am I missing the point?
Thanks Harry
is working on a reply...