Skip to main content

Module cache_server

Module cache_server 

Source
Expand description

Standalone cache server.

Runs a lightweight HTTP server that exposes only cache and pub/sub endpoints. This allows the cache to be deployed independently of the main pylon server for horizontal scaling.

§Usage

pylon cache --port 6380 --max-keys 100000 --max-history 100

§Endpoints

  • POST /cache – execute a cache command (same protocol as /api/cache)
  • GET /cache/:key – shorthand GET
  • DELETE /cache/:key – shorthand DELETE
  • POST /pubsub/publish – publish a message
  • GET /pubsub/channels – list channels
  • GET /pubsub/history/:ch – channel history
  • GET /health – health check

Functions§

start_cache_server
Start a standalone cache server on the given port.
start_cache_server_with_options
Start a standalone cache server with optional RESP protocol support.