regarding memcache client...

Discussion in 'Ruby' started by hemant kumar, Aug 30, 2006.

  1. hemant kumar

    hemant kumar Guest

    Hi,

    I am using memcache-client written by beloved :) eric hodel for session
    caching in rails, and but I would like to use this for some in-memory
    caching in my other programs.

    I am not able to use it outside rails somehow. require 'memcache' throws, no
    such file to load, when I have the gem in
    "/usr/lib/ruby/gems/1.8/gems/memcache-client-1.3/ and rails is using it
    allright.

    The API for memcache also doesn't make it clear, how do I use it in my own
    applications. can anyone clarify on this?

    Also, when using CachedModel for activerecord caching..how exactly it works?
    how often will it do read and write to db?

    What exactly is meant by "in-process" caching that CacheModel does?
    Also the after_filter stuff that is supposed to flush the local cache in
    rails, I would like to know what is meant by "local cache" stuff and how it
    determines when to flush that content?
    hemant kumar, Aug 30, 2006
    #1
    1. Advertising

  2. If mechanize was installed as a gem do you have:
    require 'rubygems'
    before the:
    require 'mechanize'

    hemant kumar wrote:
    > Hi,
    >
    > I am using memcache-client written by beloved :) eric hodel for session
    > caching in rails, and but I would like to use this for some in-memory
    > caching in my other programs.
    >
    > I am not able to use it outside rails somehow. require 'memcache' throws, no
    > such file to load, when I have the gem in
    > "/usr/lib/ruby/gems/1.8/gems/memcache-client-1.3/ and rails is using it
    > allright.
    >
    > The API for memcache also doesn't make it clear, how do I use it in my own
    > applications. can anyone clarify on this?
    >
    > Also, when using CachedModel for activerecord caching..how exactly it works?
    > how often will it do read and write to db?
    >
    > What exactly is meant by "in-process" caching that CacheModel does?
    > Also the after_filter stuff that is supposed to flush the local cache in
    > rails, I would like to know what is meant by "local cache" stuff and how it
    > determines when to flush that content?
    >
    >
    >
    Cliff Cyphers, Aug 30, 2006
    #2
    1. Advertising

  3. hemant kumar

    Eric Hodel Guest

    On Aug 30, 2006, at 5:26 AM, hemant kumar wrote:

    > I am using memcache-client written by beloved :) eric hodel for
    > session
    > caching in rails, and but I would like to use this for some in-memory
    > caching in my other programs.
    >
    > I am not able to use it outside rails somehow. require 'memcache'
    > throws, no
    > such file to load, when I have the gem in
    > "/usr/lib/ruby/gems/1.8/gems/memcache-client-1.3/ and rails is
    > using it
    > allright.


    You probably forgot to require 'rubygems'.

    > The API for memcache also doesn't make it clear, how do I use it in
    > my own
    > applications. can anyone clarify on this?


    Start with the documentation:

    http://dev.robotcoop.com/Libraries/memcache-client/index.html

    How you use it in your own application depends upon what you want to
    cache.

    > Also, when using CachedModel for activerecord caching..how exactly
    > it works?
    > how often will it do read and write to db?


    http://dev.robotcoop.com/Libraries/cached_model/index.html

    CachedModel has write-through behavior.

    > What exactly is meant by "in-process" caching that CacheModel does?
    > Also the after_filter stuff that is supposed to flush the local
    > cache in
    > rails, I would like to know what is meant by "local cache" stuff
    > and how it
    > determines when to flush that content?


    The local cache is just a hash. If you don't flush it it will fill
    up your memory with ActiveRecord objects. I recommend not using it.

    --
    Eric Hodel - - http://blog.segment7.net
    This implementation is HODEL-HASH-9600 compliant

    http://trackmap.robotcoop.com
    Eric Hodel, Aug 31, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hemant

    Using Memcache client

    hemant, Sep 20, 2006, in forum: Ruby
    Replies:
    1
    Views:
    112
    Eric Hodel
    Sep 21, 2006
  2. Eric Hodel
    Replies:
    0
    Views:
    89
    Eric Hodel
    Oct 18, 2006
  3. Eric Hodel
    Replies:
    0
    Views:
    99
    Eric Hodel
    Dec 7, 2006
  4. Eric Hodel
    Replies:
    0
    Views:
    85
    Eric Hodel
    Mar 7, 2007
  5. Brian Candler

    Which memcache client?

    Brian Candler, Mar 9, 2007, in forum: Ruby
    Replies:
    1
    Views:
    98
    Philip Hallstrom
    Mar 9, 2007
Loading...

Share This Page