Caching
Powerful caching utilities to reduce database and API requests.
Simple Cache
Example Usage
import { cache } from "#core/util"
// Set a value in the cache
cache.set("key1", "some value")
// Get a value from the cache
const value = cache.get<string>("key1")
// Ensure a default value if the key is missing
const defaultValue = cache.ensure<string>("key2", "default")Methods
Good practices
ResponseCache from @ghom/orm
@ghom/ormExamples Usage
1. Create a new ResponseCache for a slow API request.
2. Use the built-in ResponseCache for a slow SQL query.
Methods
Use Cases
Last updated