In-memory cache implementation for development and testing.
Features:
Suitable for:
NOT suitable for:
In-memory cache implementation for development and testing. Features: - Thread-safe operations using Clojure atoms - TTL support with automatic expiration - LRU eviction policy - Statistics tracking - Pattern matching - Namespace support Suitable for: - Local development without Redis - Fast unit testing - CI/CD pipelines - Single-process applications NOT suitable for: - Distributed systems (not shared across processes) - Production use (no persistence) - High-memory workloads (limited by JVM heap)
Redis-backed distributed cache implementation.
Features:
Suitable for:
Redis Data Structures Used:
Redis-backed distributed cache implementation. Features: - Distributed caching across multiple processes - Automatic TTL and expiration - Atomic operations (INCR, DECR, SETNX) - Pattern matching with SCAN - Namespace support - Connection pooling Suitable for: - Production deployments - Distributed systems - High-availability applications - Microservices architecture Redis Data Structures Used: - Strings: For cache values (Nippy serialized, stored as binary) - TTL: Built-in Redis expiration - Atomic ops: INCR, DECR, SETNX, etc.
Integrant wiring for the cache module.
Supports two providers selectable via config:
Config key: :wagoe/cache Example (Redis): {:provider :redis :host "localhost" :port 6379 :default-ttl 300 :max-total 20 :max-idle 10 :min-idle 2}
Example (in-memory): {:provider :in-memory :default-ttl 300 :max-size 10000}
Integrant wiring for the cache module.
Supports two providers selectable via config:
- :redis — distributed Redis-backed cache (production)
- :in-memory — local atom-based cache (dev / tests without Redis)
Config key: :wagoe/cache
Example (Redis):
{:provider :redis
:host "localhost" :port 6379
:default-ttl 300
:max-total 20 :max-idle 10 :min-idle 2}
Example (in-memory):
{:provider :in-memory
:default-ttl 300
:max-size 10000}No vars found in this namespace.
Tenant-aware caching with automatic key prefixing.
This module provides tenant-scoped cache operations to prevent cache collisions between tenants in multi-tenant applications.
Key Features:
Usage: ;; Wrap existing cache with tenant context (def tenant-cache (create-tenant-cache cache tenant-id))
;; Use normally - keys automatically prefixed (ports/set-value! tenant-cache :user-123 user-data) ;; Actual key: "tenant:abc123:user-123"
;; Bulk operations work too (ports/set-many! tenant-cache {:user-1 data1 :user-2 data2}) ;; Keys: "tenant:abc123:user-1", "tenant:abc123:user-2"
Pattern: All cache keys are prefixed with: tenant:<tenant-id>:<original-key> Example: tenant:acme_corp:user:456
Tenant-aware caching with automatic key prefixing.
This module provides tenant-scoped cache operations to prevent cache
collisions between tenants in multi-tenant applications.
Key Features:
- Automatic tenant-id prefixing for all cache keys
- Transparent tenant context extraction from middleware
- Compatible with all ICache implementations (Redis, in-memory)
- No changes required to existing cache calls
- Complete cache isolation between tenants
Usage:
;; Wrap existing cache with tenant context
(def tenant-cache (create-tenant-cache cache tenant-id))
;; Use normally - keys automatically prefixed
(ports/set-value! tenant-cache :user-123 user-data)
;; Actual key: "tenant:abc123:user-123"
;; Bulk operations work too
(ports/set-many! tenant-cache {:user-1 data1 :user-2 data2})
;; Keys: "tenant:abc123:user-1", "tenant:abc123:user-2"
Pattern:
All cache keys are prefixed with: tenant:<tenant-id>:<original-key>
Example: tenant:acme_corp:user:456cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |