Redis and Caching Configuration

OSA Proxy implementation

This page describes the current OSA Proxy implementation. The archived Java/Spring implementation is available in Archived Java/Spring implementation.

OSA Proxy supports Redis caching for Judge verdicts to speed up repeated requests and reduce CodeScoring load. The cache is disabled by default.

cache:
  judge:
    enabled: true
    ttl: 24h
    refresh-after: 30m
    proactive-refresh-enabled: false
    proactive-refresh-interval: 2h
    proactive-refresh-workers: 10
    key-prefix: "cs:judge:"
  redis:
    address: redis:6379
    password: ""
    db: 0

Parameters

ParameterPurpose
cache.judge.enabledEnables Redis cache for Judge check results.
cache.judge.ttlCache entry lifetime. Default is 24h.
cache.judge.refresh-afterEntry age after which it can be refreshed in the background. Default is 30m.
cache.judge.proactive-refresh-enabledEnables periodic background refresh for stale entries. Default is false.
cache.judge.proactive-refresh-intervalBackground refresh interval. Default is 2h.
cache.judge.proactive-refresh-workersNumber of background refresh workers. Default is 10.
cache.judge.key-prefixRedis key prefix.
cache.redis.addressRedis address in host:port format.
cache.redis.passwordRedis password.
cache.redis.dbRedis database number.
TTL and background refresh

Background refresh does not extend an entry TTL by itself. TTL is extended when data is read from the cache by real requests, so rarely used entries are eventually removed from Redis.

Cache Management

The operational API is available through Swagger UI:

https://osa-proxy.example.com/api/swagger/

Main operations:

  • DELETE /api/cache/purls — delete specific PURLs from the verdict cache;
  • DELETE /api/cache/packages/{packageType} — delete entries by package type, package name, or repository context.
Was this page helpful?