Perhaps I am missing something here but why would you serve static files from your Pyramid app? Why don't you serve the static files by the webserver directly?

As for MongoDB, how about a wrapper around the pymongo classes/objects and use lazy connectors, ie. do the actual connection only if one does not exist in the thread, whenever a pymongo method is called?


Vlad


On 03/13/2011 09:54 AM, Seth wrote:
I was advised a while back by someone to throw my MongoDB connection call into a pyramid.events.NewRequest subscriber. However, this has proven to be a bad idea because the NewRequest subscriber gets called even if the request is a static_route request, and since the event.request object in the NewRequest subscriber doesn't have a matched_route attribute, there's no bullet-proof way to filter those out.

How are other people connecting to a db with high-traffic sites using Pyramid and avoiding the static_route re-connection nonsense? Perhaps we could request to get a matched_route object on the NewRequest event object?

Thanks,
Seth


--
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to