memory-bank/components/openvsx-proxy.md
The OpenVSX-Proxy component in Gitpod is a caching proxy service for the OpenVSX registry, which is a repository for VS Code extensions. It stores frequently used requests to the OpenVSX registry and serves these cached responses when needed, particularly when the upstream registry is unavailable. This ensures that VS Code extensions remain accessible to Gitpod workspaces even during OpenVSX outages, improving the reliability and resilience of the IDE experience.
The primary purposes of the OpenVSX-Proxy component are:
The OpenVSX-Proxy component consists of several key parts:
The component operates as an HTTP server that intercepts requests for VS Code extensions, checks its cache for a valid response, and either serves the cached response or forwards the request to the upstream registry.
The OpenVSX-Proxy component is configured through a JSON configuration file:
{
"log_debug": false,
"cache_duration_regular": "1h",
"cache_duration_backup": "168h",
"url_upstream": "https://open-vsx.org",
"max_idle_conns": 100,
"max_idle_conns_per_host": 10,
"redis_addr": "redis:6379",
"prometheusAddr": ":9500",
"allow_cache_domain": ["open-vsx.org"]
}
log_debug: Enables debug loggingcache_duration_regular: Duration for the regular cache tier (e.g., "1h" for 1 hour)cache_duration_backup: Duration for the backup cache tier (e.g., "168h" for 1 week)url_upstream: URL of the upstream OpenVSX registrymax_idle_conns: Maximum number of idle connectionsmax_idle_conns_per_host: Maximum number of idle connections per hostredis_addr: Address of the Redis server (if using Redis for caching)prometheusAddr: Address for exposing Prometheus metricsallow_cache_domain: List of domains for which caching is allowedThe OpenVSX-Proxy component integrates with:
components/common-go: Common Go utilitiesgithub.com/eko/gocache: Caching librarygithub.com/allegro/bigcache: In-memory cache implementationgithub.com/go-redis/redis: Redis clientgithub.com/sirupsen/logrus: Logging librarygithub.com/google/uuid: UUID generationgithub.com/go-ozzo/ozzo-validation: Configuration validationThe component implements several security measures:
The proxy implements a two-tier caching strategy:
When a request is received:
The request handling flow: