Skip to content

Repository files navigation

kv-cache

This is a key‑value cache service with TTL and periodic tasks for deletion.

Quick Start

  • Setup .env for this use example.env
PORT=8080 # Port for http 
PERIODIC_SEC=10 # Poll the storage for deletion by ttl.
  • Routes
  • GET / - get all - 200 OK
  • DELETE /:kid - 204 No Content
  • GET /:kid - get by key - 200 OK
{
    "new": {
        "ttl": "1788763361206478µs", // or null if not set
        "value": "test2"
    }
}
  • POST / - 201 Created
{
    "key": "new",
    "value": {
        "value": "test2",
        "ttl": 5 // now + 5 seconds. This nullable
    }
}

Future

  • Switch from HTTP to binary protocol and use client for connect.
  • Add auth to connect.

About

This is a key‑value cache service with TTL and periodic tasks for deletion.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages