Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question A question about the caching system

Discussion in 'Cloud Code' started by Kurutah, Apr 15, 2024.

  1. Kurutah


    Jul 19, 2017
    In the example from the documentation, I see information about caching, but I can’t figure it out - does this only apply to data called through RemoteConfigSettings.AssignSettingsGetAsync (and with Remote Config in general)?

    If in a class similar to QuestService, I just create a variable with a different kind of data (for example, some integer to store the last ID this player voted recently for to compare - and this is not "Remote Сonfig" data), is there a chance that the value of this variable will be preserved upon the next function call from the client side? If yes, how long does this work? Thank you.
  2. MariusUrbelis


    Unity Technologies

    Mar 15, 2015

    If you will notice here in the QuestService, the quest items that come from Remote Config are stored in a local variable in Cloud Code for 5 minutes.

    This only applies to Cloud Code C#, but if you choose to implement such caching like you mentioned: the value of the integer will stay there in Cloud Code for 15 minutes if there are no requests to your endpoints. However, if the traffic is steady and Cloud Code does not scale down, this cache could stay there more or less indefinitely.
    Kurutah likes this.