Hi,
I want to use rails page caching to speed up a application which encounters heavy load. But I also need to count the hits/views on the objects presented. So I have the model "Article" with a unique hit counter method (by IP) which is called every time the user hits the show action. That doesn't work with caching, so I'm wondering about the right way to solve this problem. There is no need for the counter to show real-time results.
Thoughts so far:
- Use Cron and a Rake task to analyze the log/production.log file
- Write to a custom log (how? using nginx)
Thanks for any input, ideas or best practice examples!