Hi Carl, no problem :) As I wrote in another post I need to use (read & write) a small amount of data (about 200Kb) in a before_filter to. I need to operate *fast* and the DB is not a viable solution (the I need to pack it as plugin so I prefer to don't have any DB dependencies). Filesystem... is not supported on Heroku :P So locally I tested a global var and it did its work. Yes I know it is not a best practice.
Any other ideas? Thank you for your time. On 10 Mar, 17:25, Carl Fyffe <[email protected]> wrote: > Daniele, > > My apologies for coming across rude, it was not my intention, which > was why I apologized up front. As Chris said, there are better ways to > skin the global variable cat. Also, in most Ruby docs it says use them > sparingly: > > http://www.rubyist.net/~slagell/ruby/globalvars.html > > Which to most people means, avoid at all costs. You can put them in > the db. If they are constant and never change, you can put them in > config. If they are client specific, put them in a cookie and store > them in the browser (as long as they aren't huge). If they are huge, > then the database is your best bet because you don't want to clutter > your memory with it. If the database is to slow, then put it on the > file system. > > But whatever you do, please avoid using global variables. I have > googled for the article that explains why, but I can't find it. All I > could find was a repeat of the "use sparingly". > > As I said earlier, benchmark the easiest solution first. It might just > meet your needs. -- You received this message because you are subscribed to the Google Groups "Heroku" 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/heroku?hl=en.
