I have static cached pages that I want to track and then sort by popularity.
What would be the best way to track these views in Redis and then load them back into the main database?
Now I'm thinking about using jquery like this
$.get("/track/", { id: "1234" } );
and using redis gem in the "track" controller to call
redis.incr "1234"
Once a day, I ran cron for something like
Pages.each do |p| p.hits = redis.get(p.id.to_s) end
source share