Forum: Ruby on Rails Calculate Page views efficiently

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
deepu (Guest)
on 2009-01-28 20:04
(Received via mailing list)
     I am coding forum software in rails. In forum software how many
times a thread is viewed is an important metric .one way of doing this
is creating a before_filter which logs in a view everytime a page is

actually just because i need to run this before_filter i can't do page
caching which can drastically improve the performance of the app. can
anyone suggest a better way of logging views of every thread.
Thomas S. (Guest)
on 2009-01-28 20:15
(Received via mailing list)
Maybe with a distinct insert into a history table?  thread_views
(thread_id int, view_count) outside of the before_filter... somewhere

Or parsing of the logs?
deepu (Guest)
on 2009-01-28 21:13
(Received via mailing list)
              thanks for the reply. But the very act of inserting into
any table means i cannot use  page caching which will be  aserious
performance penalty to pay.

i will explore the logs option though. thanks

This topic is locked and can not be replied to.