Redis and Caching Configuration
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.
Parameters
Redis TLS
To enable TLS, configure:
OSA Proxy uses TLS 1.2 or newer and always verifies the server certificate. Certificate verification cannot be disabled.
When ca-file is empty, the container system trust store is used. When a PEM file is specified, its certificates are added to the system roots rather than replacing them. Leave server-name empty in most deployments so that each connection is verified against the hostname in its address. A non-empty value sets one shared SNI and verification identity for Redis, every Sentinel endpoint, and the discovered master; use it only when that name is present in the SAN of every relevant certificate.
The standard osa-proxy.yml maps these settings to environment variables:
Corporate CA with Docker Compose
For a directory containing corporate CAs, add it to SSL_CERT_DIR while retaining the system directory /etc/ssl/certs:
With an empty REDIS_TLS_CA_FILE, Redis uses the system trust store together with certificates from SSL_CERT_DIR. Alternatively, mount a dedicated PEM bundle and set its container path in REDIS_TLS_CA_FILE.
Corporate CA with Helm
Create a Secret containing the PEM certificates:
Enable Redis TLS and mount the Secret through the chart CA directory:
The chart adds the mounted directory to the system SSL_CERT_DIR, so ca-file can remain empty. Restart the OSA Proxy pods after updating the Secret so that the client reloads the CAs.
Redis Sentinel
Enable Sentinel for Redis HA. A regular cache.redis.address is not required in this mode. Redis master and Sentinel credentials are configured independently:
In Sentinel mode, one TLS configuration is used for both Sentinel and the discovered Redis master. Therefore, with tls.enabled: true, both services must accept TLS and use certificates trusted by OSA Proxy.
If Redis is temporarily unavailable, OSA Proxy continues to use the available local caching mechanisms.
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
Cache purge endpoints and Swagger UI have moved from the main port :8080 (where /api/swagger and /api/cache/... were previously hosted) to the dedicated Admin API listener (default :8081, configured under admin in osa-proxy.yml). Administrative methods under /api/v1/... require a Bearer token.
Purging verdict cache entries is performed through the Admin API on its dedicated listener (default :8081). Admin API requests require a Bearer token in the Authorization header.
Interactive Swagger UI documentation is available at:
Main cache purge endpoints:
DELETE /api/v1/cache/purls— delete entries by specific PURLs (the request body contains a JSON array ofpurls);DELETE /api/v1/cache/packages/{packageType}— delete entries by package type with optional filtering by package name (packageName) and repository context (repositoryNameandrepositoryManagerUrl).
For complete parameter descriptions, authentication details, and curl examples, see Admin API.
