Using Memcache in Ruby Programs
Memcache is a high-performance open-source caching server daemon and it's robust, fast & distributed system. Memcached has a client-server model, the memcached daemon listens of default port 11211, which obviously can be configured to our requirements.
In this article we will be looking at a Ruby gem which will be used to implement the benefits of memcache in our Ruby programs, the memcache gem uses libmemcached C library which makes it faster than pure-Ruby memcache gems. I had earlier written an article Faster Webapps With Memcache, which is a good read for beginners.
To install the gem just issue the following command in shell:
Memcached Ruby gem is pretty easy to use, the following code snippets will be self-explanatory.
I hope this was helpful in getting you started with using memcached in your Ruby programs.
|All times are GMT +5.5. The time now is 11:58.|