Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BYO-Cache #67

Open
grosser opened this issue Jun 18, 2012 · 5 comments
Open

BYO-Cache #67

grosser opened this issue Jun 18, 2012 · 5 comments

Comments

@grosser
Copy link
Collaborator

grosser commented Jun 18, 2012

I'd like to "bring my own cache".

  • Why are there so many cache-implementation-reinventions ?
  • Why do I have to build something rack-specific just to get some caching ?
  • Why do I have to even bother with entity/metastore ? (it may be nice for advanced users, but lets start simple)

can we just focus on support a simple interface like []/[]=/clear moneta style or read/write/fetch/clear and be done with this ?

  • removes a ton of code/bugs/indirection
  • make it easier to use
  • makes it easier to debug

I don't want to learn how rack-cache works internally, does it really have to be more complicated then:
use Rack::Cache, :cache => Rails.cache
use Rack::Cache, :cache => MyOwnCachenew

maybe at most:
use Rack::Cache, :enititystore => Rails.cache, :metastore => ActiveSupport::Cache::Memorystore.new

would also solve support for mongodb/redis/multi-server-memcache etc and surely a few issues.

@minad
Copy link

minad commented Dec 8, 2012

As backend you could use https://github.com/minad/moneta

@grosser
Copy link
Collaborator Author

grosser commented Dec 9, 2012

Yep, same []/[]= interface, would be nice if we could just plug anything in :)

@minad
Copy link

minad commented Dec 9, 2012

Added support to moneta for now:

https://github.com/minad/moneta/blob/master/lib/rack/cache/moneta.rb

You get a lot of key/value stores for free: redis, memcached, tokyo, riak, cassandra, couch, mongo, ...

This entitystore/metastore thing and the uri lookup thing are very much overengineered. It would be much better to replace this with something simpler.

@grosser
Copy link
Collaborator Author

grosser commented Dec 9, 2012

Thanks, redis->juno->rack it is then... still feels like a wtf solution to a dead-simple problem...

@grosser
Copy link
Collaborator Author

grosser commented Sep 9, 2014

@rtomayko just set up a new app an ran into exactly the same issue :(
Would you merge a PR that remove all this caching magic and just accepts a cache-store that responds to read/write (railsy) or ([]/[]=) monetay ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants