

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 键入 CacheConfig
<a name="retrieving-secrets_cache-go_CacheConfig"></a>

适用于[缓存](retrieving-secrets_cache-go_cache.md)的缓存配置选项，例如最大缓存大小、默认[版本阶段](whats-in-a-secret.md#term_version)，以及已缓存密钥的存活时间 (TTL)。

```
type CacheConfig struct {

    // The maximum cache size. The default is 1024 secrets.
    MaxCacheSize int
            
    // The TTL of a cache item in nanoseconds. The default is 
    // 3.6e10^12 ns or 1 hour.
    CacheItemTTL int64
            
    // The version of secrets that you want to cache. The default 
    // is "AWSCURRENT".
    VersionStage string
            
    // Used to hook in-memory cache updates.
    Hook CacheHook
}
```