# First Cloud Code request takes 6-15 seconds

**URL:** https://discussions.unity.com/t/first-cloud-code-request-takes-6-15-seconds/1695639
**Category:** Cloud Code
**Tags:** Cloud-Code, Question
**Created:** [November 16, 2025, 11:07pm UTC](https://discussions.unity.com/t/first-cloud-code-request-takes-6-15-seconds/1695639 "2025-11-16T23:07:51Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rxr\_russ](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rxr\_russ](https://discussions.unity.com/u/rxr_russ)
#### Post date: [November 16, 2025, 11:07pm UTC](https://discussions.unity.com/t/first-cloud-code-request-takes-6-15-seconds/1695639/1 "2025-11-16T23:07:51Z")

</div>

Hello!  
I’m using CloudCode to obfuscate some endpoints. The module itself is pretty simple- it takes a string in and returns a different string based on a switch statement.

When I launch the game (PC & Steam) via editor or full build, I end up waiting anywhere from 6-15 seconds to get the first response back on the function that requests that string.  
Further uses of that function seem to come back nearly instantly. And, if I close and relaunch (or stop and restart the editor), there’s a good chance the time will drop significantly for the first request- though I still see extended first-run times randomly.

Is this expected? Or is there something I can do to ‘pre-warm’ the code? I currently use it just after player sign-in.

Simplified Engine Code:

```auto

try{
    Debug.Log("Getting Cloud Code item: " + _str); // Gives me a "start" time for a given call
    NetHandlerBindings module = new NetHandlerBindings(CloudCodeService.Instance);  
    _target = await module.GetAssociatedStr(_str);
    Debug.Log("Cloud code finished: " + _str); // Gives me a end time for the call. 
    return _target;
}

```

Simplified Cloud Code:

```auto
public string GetAssociatedStr(string _str)
{
    switch (_str)
    {
        case "abc":
            return abcStr;
       // continues with other switch cases, aprx 10 in total

```

Any help on this is really appreciated!

---

<div class="post-metadata">

### Author: ![Kurt-Dekker](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/kurt-dekker/32/101578_2.png) [@Kurt-Dekker](https://discussions.unity.com/u/Kurt-Dekker)
#### Post date: [November 17, 2025, 2:39am UTC](https://discussions.unity.com/t/first-cloud-code-request-takes-6-15-seconds/1695639/2 "2025-11-17T02:39:01Z")

</div>

Perhaps this?

> [@Cold start of C# CloudCode](https://discussions.unity.com/t/cold-start-of-c-cloudcode/1512317/2):
>
> Hi there! If you’re game is receiving active traffic (likely in a production environment of your game), you should not experience a cold start, so long as there is at least 1 request per 15 minutes to your module (you can see more about this [here](https://docs.unity.com/ugs/en-us/manual/cloud-code/manual/modules/getting-started#Call_the_module_function)). In development you are more likely to encounter cold starts, however we are currently working to mitigate this in the future. With respect to the 200~600ms response times, this could be affected by a number of factors, such as how many other service…

---

<div class="post-metadata">

### Author: ![rxr\_russ](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@rxr\_russ](https://discussions.unity.com/u/rxr_russ)
#### Post date: [November 17, 2025, 3:47am UTC](https://discussions.unity.com/t/first-cloud-code-request-takes-6-15-seconds/1695639/3 "2025-11-17T03:47:15Z")

</div>

Ah- I should have RTFM!

For anyone else seeing this, this exert from the [linked](https://docs.unity.com/ugs/en-us/manual/cloud-code/manual/modules/getting-started#call_the_module_function) documentation is probably what’s going on:

> **Important** : If a module hasn’t received any traffic in the last 15 mins, you might experience a cold start latency. Any subsequent calls to the module are faster.

There’s also some info about cold-starts in best-practices [here](https://docs.unity.com/ugs/en-us/manual/cloud-code/manual/best-practices)

What it _doesn’t_ specify is what that “cold start latency” looks like- but I’m guessing its what I’m experiencing.

So, lesson learned- double check the documentation!
