Skip to content
GitHub

Quickstart

Terminal window
uv add lexigram-cache
import asyncio
from lexigram import Application
from lexigram.cache import CacheModule
async def main():
async with Application.boot(
name="my-app",
modules=[CacheModule.configure()],
) as app:
from lexigram.cache import CacheService
cache = await app.container.resolve(CacheService)
await cache.set("greeting", "Hello, Lexigram!")
value = await cache.get("greeting")
print(value) # "Hello, Lexigram!"
asyncio.run(main())
from lexigram import Application
from lexigram.cache import CacheProvider
def create_app() -> Application:
app = Application(name="my-app")
app.add_provider(CacheProvider())
return app
from lexigram.cache import CacheModule
# In-memory backend with no external connections
test_module = CacheModule.stub()
  • Guide — caching concepts and workflows
  • How-Tos — Redis, Memcached, stampede protection recipes
  • Configuration — all configuration keys