Git Product home page Git Product logo

adonis-cache's People

Contributors

helnokaly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

adonis-cache's Issues

toJSON() mutates object in cache

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.

exit remember

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.

Great job!

Hi!

Just wanted to thank you for this adonis addon ๐Ÿ”ฅ

Adonis 4

Any chance of getting this updated for Adonis 4?

[ASK] How to clear expired cache

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.