Giter Club home page Giter Club logo

Comments (3)

m1 avatar m1 commented on August 22, 2024

Just set cache to false when in development, it'll stop the cache being built. I was thinking about rebuilding the cache module anyway to do similar to what you were saying anyway.

https://github.com/m1/Vars#options

from vars.

m1 avatar m1 commented on August 22, 2024

@francislavoie okay to close this?

from vars.

francislavoie avatar francislavoie commented on August 22, 2024

Sorry I never answered, I still think this is needed. There needs to be a good way to invalidate the cache. You said you were thinking about rebuilding the cache module, so I think it's worth keeping this issue open until you get to that.

I was thinking about writing a PR for this, but right now there's no obvious way to get a list of the files loaded from the cache module. It would need a bit of a rewrite to make that information available, and that's more work than I have time to commit.

Your suggestion for development is fine, but I don't just want this for development, I want it for production too so I don't have to wipe the cache (delete the vars folder) or wait 5 minutes. I also use a long-running job queue service, and if the config is changed I need to reboot those as well (they only read config once at the start) and if the old config is cached and I reboot them, then they'll still have the old config. So I always have to wipe the cache myself every time I make a change.

For now, I'm going to write a manual check ahead of where I load M1\Vars\Vars where I do filemtime against the cache and my config file, if the config is newer I'll unlink the cache file.

Thanks!

from vars.

Related Issues (16)

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.