image
Akan.js
English
DocsConventionsReferencesCheatsheet
image
Akan.js
DocsConventionsReferencesCheatsheet
Released under the MIT License
Official Akan.js Consulting onAkansoft
Copyright © 2026 Akan.js All rights reserved.
System managed bybassman
General
• Authorization
• Schema Design
• Edge Computing
• File Management
• Single Sign-On
• DataList & Enum
Interface
• CRUD
• Endpoint
• Form
Observability
• Logging
• Dependency Injection
• Error Handling
• Metrics
Performance
• Caching
• Image Optimization
• Lazy Loading
• Querying
• Queueing
• Realtime
Development
• Documentation
• Script
• Docker
• Kubernetes
General
• Authorization
• Schema Design
• Edge Computing
• File Management
• Single Sign-On
• DataList & Enum
Interface
• CRUD
• Endpoint
• Form
Observability
• Logging
• Dependency Injection
• Error Handling
• Metrics
Performance
• Caching
• Image Optimization
• Lazy Loading
• Querying
• Queueing
• Realtime
Development
• Documentation
• Script
• Docker
• Kubernetes
Next
Authorization

Server Caching

Caching is a small key-value shortcut in front of expensive work. Use it for data that is safe to reuse for a short time, such as verification codes, counters, summaries, or computed options.
  • Document cache is close to one model.
  • Service memory is useful for service-level state or shared helper values.
  • The provider can be sqlite/libsql or redis depending on runtime mode.

Document Cache

Use model cache inside the document layer when the cached value naturally belongs to that model. Keep the namespace small and delete it when the source changes.
Cache a short-lived code

Service Memory

Use `memory()` when a service needs a small value that survives across calls. It can be a single value, a map, or local process memory.
Service-level cache

Which One?

  • Use document cache when the key is a model id.
  • Use service memory when the value belongs to a service workflow.
  • Use local memory only for values that do not need to be shared between replicas.

Tips

  • Prefer short TTLs first. You can extend them after the behavior is stable.
  • Make cache keys boring: namespace plus id is usually enough.
  • Delete or refresh cache right after updating the source data.
  • Never treat cache as the source of truth. It is only a fast copy.
Server Caching
Document Cache
Service Memory
Which One?
Tips