Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

BYO-Cache #67

Open
grosser opened this Issue · 5 comments

2 participants

@grosser

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

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

@grosser

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

@minad

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

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

@grosser

@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
Something went wrong with that request. Please try again.