기술 자료

​
​

Development

User Acquisition

Monetization

산업 분야

Cloud Code

Scripting API

Services C# SDKs

Services JavaScript SDKs

Admin REST API

Client REST API

Scheduler Admin REST API

Observability REST API

Open Unity Dashboard

Cloud Code

이 페이지는 선택한 언어로 제공되지 않습니다.
LiveOps
​
​
Cloud Code
  • Overview
  • Get started
  • Server authority
  • Cloud Code C# modules
    • Overview
    • Get started
    • Concepts
    • Tutorials
      • Run modules
      • Write modules
      • Development essentials
        • Write unit tests
        • Dependency injection
        • Custom serialization
        • Batch requests
        • In-memory cache
      • Automate deployment
      • Integrate services
      • Advanced configuration
      • Use Cases
    • Reference
  • Cloud Code JavaScript scripts
  • Logging
  • Use-case samples
  • Privacy and consent
  1. Cloud Code

In-memory cache

Cache slow-changing data between C# module endpoints to speed up response times and reduce calls to other services.
읽는 시간 1분
최근 업데이트: 2달 전

You need a fast response time when a client makes a server call. While calling other UGS services in Cloud Code is fast, each request adds latency. For information that doesn't change often, you can introduce a cache to speed up response times. For example, you can cache game configurations stored in Remote Config or Cloud Save.
When a C# module runs on a worker, the worker shares memory between module endpoints. You can create an in-memory cache (Microsoft) to use between these endpoints. This allows your code to load some information from another service, such as Remote Config, into the in-memory cache and use that cache for the next request. This means your code doesn't have to call out to Remote Config again until the cache expires.

Limitations

There are some caveats to using an in-memory cache:
  • There's no guarantee that the module state persists between calls. The deployment of a module, a cold-start after inactivity, or routine maintenance can cause the module to load onto a different worker.
  • Workers can reload for multiple reasons, so don't depend on the data and don't store data that needs to persist long term.
  • Requests from the same user might go to different workers, so don't use in-memory caching to cache player data. This includes caching Remote Config with Game Overrides, unless the Game Override targets all players.
  • A worker has a 256 MB memory limit, so the cache can't hold large amounts of data.

Copyright © 2026 Unity Technologies
법률 정보개인정보 처리방침쿠키Documentation Terms of Use개인 정보 판매 또는 공유 금지개인정보 보호 선택(쿠키 설정)

'Unity', Unity 로고 및 기타 Unity 상표는 미국 및 기타 지역 내 Unity Technologies 또는 그 계열사의 상표 또는 등록상표입니다(자세한 내용은 여기에서 확인하세요). 기타 명칭 또는 브랜드는 해당 소유자의 상표입니다.

일부 페이지는 편의를 위해 기계 번역되었으며 부정확한 내용이 있을 수 있습니다. 정보가 상충되는 경우, 영어 버전을 우선으로 참조하세요.

  • 보고 있는 페이지
    • Limitations


이 페이지의 문제 보고