[Rails] Re: Caching of data on server?

2010-04-23 Thread Pieter Hugo
Hi Guys Thanks for the help - and the warning. I got the global variable thing working - in principle - but now rails complains that I cannot do something like $rights = Rights.find(:all) in environment.rb I'm giving it up for a bad job - (not that I need to squeeze the last drop of performa

[Rails] Re: Caching of data on server?

2010-04-22 Thread Sijo k g
Marnen Laibow-Koser wrote: > Sijo k g wrote: >> Hi Pieter > > > No, those are class variables. Global variable names start with > different characters in Ruby. > O Sorry That was my mistake. Global variables starts with $. Example $var. And you can take a loook at http://github.com/defunkt/

[Rails] Re: Caching of data on server?

2010-04-22 Thread Marnen Laibow-Koser
Sijo k g wrote: > Hi Pieter > >> Is it possible to create variables in the rails environment that persist >> globally - not as sessions - that would be too much porting of >> information forwards and back. > >This is possible by global variables in ruby (variables starts with > @@ ) No,

Re: [Rails] Re: Caching of data on server?

2010-04-22 Thread Colin Law
On 22 April 2010 11:58, Pieter Hugo wrote: > Hi Sijo > > Thanks for the info - I will look in to the @@ idea > >>>In any case the data needs to be visible >>> 'between' sessions as well. >> >>    But this needs the data to be stored in D B it self. Is it? > > Yes - The data is currently in a table

[Rails] Re: Caching of data on server?

2010-04-22 Thread Pieter Hugo
Hi Sijo Thanks for the info - I will look in to the @@ idea >>In any case the data needs to be visible >> 'between' sessions as well. > >But this needs the data to be stored in D B it self. Is it? Yes - The data is currently in a table in the database - it is a table of rights users have

[Rails] Re: Caching of data on server?

2010-04-21 Thread Sijo k g
Hi Pieter > Is it possible to create variables in the rails environment that persist > globally - not as sessions - that would be too much porting of > information forwards and back. This is possible by global variables in ruby (variables starts with @@ ) >In any case the data needs to be

[Rails] Re: Caching of data on server?

2010-04-21 Thread Pieter Hugo
Hi Guys Thanks for the ideas. Some good stuff here to look into. After thinking about this a bit more I'd like to slightly rephrase my question: Is it possible to create variables in the rails environment that persist globally - not as sessions - that would be too much porting of information

Re: [Rails] Re: Caching of data on server?

2010-04-20 Thread Peter Hickman
I have done something similar with a small data set that was being referenced a lot. In the end however the improvement, whilst noticeable, was not that significant. Does this data set used as it is or is it transformed before use? If so it might make sense to cache the transformed data or even t

[Rails] Re: Caching of data on server?

2010-04-20 Thread jhaagmans
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