This topic contains 3 replies, has 0 voices, and was last updated by chanarbon 7 years, 7 months ago.

  • Author
    Posts
  • #1068

    MChammaTX

    I’m not 100% clear on the purpose of the loader function in cache.get. I understand that the purpose of the function is that it will only trigger if the return value of get is null so that you can repopulate it in the event it is empty for some reason. In my case it always triggers even when something should be in the cache.

    Am I understanding the purpose of this function? The document is very unclear. Does the value retrieved from the cache get automatically passed to the loader function via a parameter or something?

    Thx.
    This is a cached copy. Click here to see the original post.

  • #1069

    chanarbon

    The purpose of the loader function is only whenever the value for a given key is no available in the cache, it would automatically handle the placing of the values for each keys through the return of the loader function. It shouldn’t trigger unless a value for the key is present in the cache. The loader function is the one that returns that data to be placed into the cache instead of doing a put to the cache.

  • #1070

    MChammaTX

    If it should only trigger when the key is not present then something is wrong as for me it triggers all the time. I omitted this property and do my own null check as a workaround.

  • #1071

    chanarbon

    MChammaTX ,

    For this concern, since the loader function triggers all the time, I would rather suggest filing a support case so that we could work with our engineers regarding the mentioned scenario.

You must be logged in to reply to this topic.