You could create a simple object (somewhere in yer /lib) that contains all
of the hard-coded configuration values and cache it using the built in
memory cache of rails:
Rails.cache.write(''key'', myobj)
The object can then be retrieved using:
Rails.cache.read(''key'')
The default cache store, ActiveSupport::Cache::MemoryStore, is not shared
between rails server processes so the object will be cached in memory for
each instance of rails you have running. This probably isn''t that big
of an
issue, if but you want to change your caching strategy you can modify the
config.cache_store to tell rails to use a different type of caching.
Apparently not all types of caching support object caching, but MemoryStore
does.
On Mon, Aug 24, 2009 at 10:13 AM, Joao Silva <
rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:
>
> I have to store a very large hierarchical data of website categories and
> pages. What is the best way to store this? It will being used to
> generate website navigation as well as must be loaded into dropdown
> selections on forms. It is STATIC and will not change and database would
> like to be avoided.
>
> Where is best place for this?? A hash in environment.rb? Loaded into
> memory?? Must be accessed fast performance is not an ISSUE but is a
> consideration.
>
> Thank you
> --
> Posted via http://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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---