RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Better caching for Rails with version_cache plugin

Caching helps alot with improving performance of your rails application but it can be a real pain and source of troubles if not done right. version_cache plugin tries to solve this problem by caching pages based on model versions. Whenever a model’s version changes, the associated page is considered to be expired. It saves you the trouble of expiring your cache which is almost the worst thing about caching.

Comments

I usually find that if it doesn’t bring your app to its knees, it’s better to just purge your cache whenever you bring your app online with new code. It’s safer, and less trouble. Of course if you’re app won’t run without a populated cache, then this looks good.

I think you’re missing the point. It’s not about new versions whenever you bring new code to your applications.

It’s about versions that track your models whenever the data changes (create, update, delete). So a page cached for version 1 will auto expire when the version increases indicating that the page should be regenerated for version 2.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in