Skip to content

Redis and Caching Configuration

OSA Proxy Go 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

Parameter Purpose
cache.judge.enabled Enables Redis cache for Judge check results.
cache.judge.ttl Cache entry lifetime. Default is 24h.
cache.judge.refresh-after Entry age after which it can be refreshed in the background. Default is 30m.
cache.judge.proactive-refresh-enabled Enables periodic background refresh for stale entries. Default is false.
cache.judge.proactive-refresh-interval Background refresh interval. Default is 2h.
cache.judge.proactive-refresh-workers Number of background refresh workers. Default is 10.
cache.judge.key-prefix Redis key prefix.
cache.redis.address Redis address in host:port format.
cache.redis.password Redis password.
cache.redis.db Redis 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.
Страница была полезна?