Giter Club home page Giter Club logo

cacheable's People

Contributors

agrberg avatar jhottenstein avatar jonbittner avatar rofreg 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

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

mchlggr

cacheable's Issues

Memoizaiton for consequent method calls on the same object

As far as I can tell from source code there is no memoization of fetched cache value for later cached method calls on the same object. Is it on purpose?

To be honest, this behavior seems to be pretty surprising:

class Foo
  include Cacheable
  cacheable :bar

  def bar
    "foo"
  end
end

foo = Foo.new

foo.bar # cache read and deserialization
foo.bar # cache read and deserialization
foo.bar # cache read and deserialization

Context: recently I saw a Rails app in the wild that cached some ActiveRecord model methods that in turn returned another ActiveRecord objects. And some places got terribly slow due to dozens of repeated calls to retrieve and deserialize which is especially slow and compute-intensive for AR objects, see this blog post for details (and yes, I know that doing so is a bad idea per se). So I had to get rid of cacheable in favor of pure memoization or manual caching with following memoization.

Not caching very big objects?

Hello there,

I am trying to cache methods calling Github API, all of them are working properly, except one in some specific conditions: It's retrieving a super long list of repositories (8200). So, I was wondering, if the value to store it's way to big, it's not being cached? How can I check that? Is there a log or something?

Thanks.

Is this gem still being maintained?

Hello, I've started to develop a gem with the same intent and similar syntax this week. While doing some research I ended up finding this gem and I wanted to know if it is still being maintained

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.