Cache

Cache Usage

Detailed examples referenceherearrow-up-right

Global Configuration

Other custom caches will inherit the global configuration if the following fields are not configured

## Cache Related Configuration
asjard:
  cache:
    ## Whether global cache is enabled
    # enabled: false
    ## Whether global auto-refresh is enabled
    # autoRefresh: false
    ## Pay attention to version differences
    ## Default cache key does not include version tag
    ## If set to true, caches will all become invalid after upgrading the service version
    # careVersionDiff: false
    # ignoreAppDiff: false
    # ignoreEnvDiff: false
    # ignoreServiceDiff: false
    # ignoreRegionDiff: false
    # ignoreAzDiff: false
    ## Global expiration time
    # expiresIn: 10m
    ## Empty value expiration time
    ## If not set, it will be half of expiresIn
    # emptyExpiresIn: 5m
    ## Global table cache configuration
    models:
      ## Table name
      ## Configuration is the same as asjard.cache related configuration
      modelName:
        # enabled: false
        # autoRefresh: false

Custom Cache

Implement the following methods

For concrete implementation refer tohttps://github.com/asjard/asjard/blob/develop/pkg/cache/cache_redis.goarrow-up-rightredis cache implementation

Last updated