Yan Pritzker photographer, entrepreneur, software engineer, musician, skier

Blog :: Git Workflows Book :: Dotfiles :: Photography :: About Me

TwitterCounter for @skwp

Get the news feed
Get updates by email
Follow me on twitter

hello, i'm yan

I am a photographer, entrepreneur, software engineer, guitarist, climber, and telemark skier

This blog is about startups, blogging, Ruby On Rails, virtualization and cloud computing, photography, customer service, marketing, ux and design, git, and lots more.

Enterprise intelligence with prediction markets

Find out what your team, colleagues and partners really know about the future — and leverage their knowledge to improve business decisions.

I'm the founder of Planypus, the place to share your plans!

Archives

Contact

Reach me at yan at pritzker.ws

Rails fragment cache with memcached-client and time-based :expire option

Posted 19 August 2006 @ 5pm | Tagged RubyOnRails, software


Submit to HN

The robot-coop’s memcache-client is the recommended memcache library to use for Rails. However, when I tried to use it with the Rails fragment cache, I found it was simply incompatible. Rails fragment cache wanted read() and write() methods, but the library only provided get() and set(). I took this opportunity to write a very simple plugin that not only provides those wrappers, but also allows easy time-based expiry syntax:


<% cache 'mykey', :expire => 10.minutes do %> ...

Grab the plugin at RubyForge!


4 Comments

Posted by
Jacek Becela
6 November 2006 @ 8am

This is my take on time-based caching (plugin url in post doesn’t work, so I had to write this myself :) Now I’m curious how your plugin looks like…

http://bigbold.com/snippets/posts/show/2975


Posted by
yan
6 November 2006 @ 8am

Oops, sorry I updated the link to point to rubyforge


Posted by
Manoel Lemos
2 December 2006 @ 9pm

Hi Yan, it seems that the memcache_fragments gem is not available at RubyForge, see:

[dev:~] root# gem install memcache_fragments
Attempting local installation of ‘memcache_fragments’
Local gem file not found: memcache_fragments*.gem
Attempting remote installation of ‘memcache_fragments’
ERROR: While executing gem … (Gem::GemNotFoundException)
Could not find memcache_fragments (> 0) in the repository
[dev:~] root#

Suggestions?


Posted by
yan
6 December 2006 @ 5pm

Yes I think it’s not available as a gem. I’ll have to repackage it and upload it there. Meanwhile please download it using the .tar.gz format http://rubyforge.org/frs/?group_id=2082&release_id=6562. ALso the fine folks at zvents.com have integrated my plugin into something they’ve built so you can check that out too: http://blog.zvents.com/2006/11/3/rails-plugin-extended-fragment-cache


Leave a Comment