Forum: Ruby on Rails Calculate Page views efficiently

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
137f06de2f189015dc8c0b2cc2a161f6?d=identicon&s=25 deepu (Guest)
on 2009-01-28 19:04
(Received via mailing list)
Hi,
     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
requested.

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.
651a0248090dbc8c4aaf431af7d6e28e?d=identicon&s=25 Thomas Sullivan (sullivant)
on 2009-01-28 19: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
else?

Or parsing of the logs?
137f06de2f189015dc8c0b2cc2a161f6?d=identicon&s=25 deepu (Guest)
on 2009-01-28 20:13
(Received via mailing list)
sullivan,
              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

Cheers,
Deepu.
This topic is locked and can not be replied to.