joystick icon indicating copy to clipboard operation
joystick copied to clipboard

Have a way to cache data to the process in memory

Open rglover opened this issue 2 years ago • 0 comments

Just a thought while writing a query for some data that could be globally cached. It's a bit risky due to memory constraints, but it'd be nice to be able to have a database query that runs on startup and populates an in-memory cache somewhere like process.databases.caches.<cache_name>.

That way, for example, if I reuse the same data over and over again (like a list of users with a role), I can set the cache once and then just read from that in my code (and if I want to update it, I can just run a cron to patch the cache on some interval).

rglover avatar Dec 06 '23 22:12 rglover