helnokaly / adonis-cache Goto Github PK
View Code? Open in Web Editor NEWCache provider for AdonisJS framework
License: MIT License
Cache provider for AdonisJS framework
License: MIT License
Simple example:
const user = await Cache.remember('cachekey', 1000, async () => {
return await User.find(1)
})
return response.json({ user: user.toJSON() })
Problem
As soon as I call user.toJSON()
, it mutates the user
object in the cache as well. Next time this code runs await Cache.remember
will not return the model, but simply the toJSON
-converted array.
Expected behaviour
The object stored in the cache should be immutable.
I am using the object cache store.
is it possible to stop the remember storing in cache.
maybe my closure fetches the value of what i want but it is not something i want cached at this time.
Hi!
Just wanted to thank you for this adonis addon ๐ฅ
Any chance of getting this updated for Adonis 4?
Hello @helnokaly ,
I have a problem that my database getting huge size because of cache. I use database CACHE_STORE, how to auto remove / clear expired cache ?
Btw very good repo, keep it up bro.
My english is not good, sorry about that.
regards
When cache is expired i get this error on first run, any idea how to fix ?
Does this library support AdonisJS v5.0 or will support in the future? https://preview.adonisjs.com/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.