Copied to clipboard

Flag this post as spam?

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


  • Philip Hayton 98 posts 435 karma points
    Aug 25, 2021 @ 10:15
    Philip Hayton
    0

    Are Relations cached?

    Hi guys,

    Does the Relationship API hit the DB each time or are they cached with everything else?

    Cheers

    Phil

  • Kevin Jump 2348 posts 14896 karma points MVP 9x c-trib
    Aug 25, 2021 @ 10:59
    Kevin Jump
    100

    Hi,

    I was going to say the answer was yes - at the database level, but checking the code for the Relations repository, it doesn't appear that they are 😕

    Most other things are cached at the DB level. - but not relations, not sure of the reasoning why. but in short no.

  • Philip Hayton 98 posts 435 karma points
    Aug 25, 2021 @ 13:36
    Philip Hayton
    0

    Thanks Kevin.

    Yeah I didn't think they were cached. Not to worry, I'll just have to monitor the performance, hopefully it won't be too much of a hit.

    Cheers

    Phil

  • Philip Hayton 98 posts 435 karma points
    Aug 25, 2021 @ 14:49
    Philip Hayton
    0

    For anyone else that is interested, the docs actually mention that you should wrap relations in a custom caching layer.

    Relation Service Docs

    Caching in Umbraco

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies