app globals is not thread safe - if you write to it concurrently you will be in trouble. I keep a lot of stuff in app globals that is set on startup and never changed.
If you need a cache use something like memcached - that works very well, and is easy to use. I can recommend doing this through beaker as it has nice features such as dog-pile-effect prevention for when your cache expires. If you cannot use memcached you can use other backends interchangably with beaker. d On Feb 9, 3:02 pm, Ross Vandegrift <[email protected]> wrote: > On Feb 8, 12:20 pm, Jonathan Vanasco <[email protected]> wrote: > > > i have some data that I cache on startup -- mostly config info and > > misc database intensive stuff. > > > i need to reload every so often. > > > is it safe to reload it into g ? or should i cache this in memcached > > or similar ? > > Have you tested this at all? I too am thinking about using g to do a > global > cache. My objects can't be pickled - they are associated with long- > running > TCP sessions and need to ensure exclusive access between threads. I > could write a standalone app to hold connections open and mediate > access, > but since I have app_globals.... > > Anyone have comments on the safety of this, from Pylons's point of > view? > > Ross -- You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en.
