Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Harry Spyrou 212 posts 604 karma points
    Oct 22, 2018 @ 11:41
    Harry Spyrou
    0

    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:

    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?

    Thanks Harry

Please Sign in or register to post replies

Write your reply to:

Draft