[Rails] Caching suggestions

Vivek Krishna
2006-01-19T07:17:49Z

Hi ,
  I have created a simple app which allows user logins and when user logs in
a home page is shown which is built using some queries to the DB. I tried
caching which didnt work properly because for some reason rails kep loading
the old cache..Anyway What I was wondering is caching only avoids the render
process but IMHO the queries are the most consuming.

My code is something like

def index
@messages =find_all_messages
# other stuff which does db query and some biz logic to create arrays which
are used in the view
render :action =>''index''
end


Even though the index can be cached the  code to create the user''s
homepage
related variables are recalculated?How do I avoid that?
Has anyone faced such an issue? I am thinking if storing the results in a
temporary table till the session is alive is a good idea.or may be check if
cache exists to avoid doing calculations,but there doesnt exist any such
API.

Any suggestions?

Regards
Vivek
-------------- next part --------------
An HTML attachment was scrubbed...