Hi Pieter,

Rails does some class caching in the default production environment.
There's more you can do though. It depends on what kind of website you
have. If you only serve semi-static content, caching your pages (or
parts of it) will improve your speed incredibly. No queries will be
made until something's updated (mind that you will have to expire
certain cache elements on changes in the database).

If you do a lot of searching, caching the pages will probably not work
for you or only do the trick partly. Do you use indexing in your
database? Using indexes can make database actions much faster.

Kind regards,
Jaap Haagmans

On 20 apr, 16:55, Pieter Hugo <[email protected]> wrote:
> Hi
>
> I am looking to speed up my rails application and am working through all
> the SQL queries and trying to remove unnecessary queries.
>
> I thought of the following and would love to hear whether it is
> possible.
>
> I have one (smallish - about 40 records) table which only gets read by
> my app - no writing. It gets read a lot though. Would it be possible to
> preload this table into memory (as a kind of global global dataset) when
> the server starts up? This would save me at least one sql query on every
> server trip.
>
> Is this even necessary? Maybe rails - (or the database?) automatically
> caches things like this?
>
> Your thoughts and suggestions are most welcome.
>
> Pieter Hugo
> --
> Posted viahttp://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to