On Jan 8, 2009, at 4:12 AM, Tycon wrote:

What does it actually do that we need to have a middleware for it that
executes in every request ?

Exactly what you said next.

Does it do anything besides insert a reference to some "Cache Manager"
into the environment ?

Nope, that's it.

If so, then why not have the Cache Manager as a regular global
object ?

That'd work as well. Either way, the same amount of code is going to run to add it to the globals.

In fact,  when using memcache there is only a single giant cache, so
then we don't even need a cache manager.

Well, if you want the locking and duplicate creation prevention checking code, and such, then you'd want the cache manager, rather than just using memcached directly. That's really what the cache manager is doing, and why you'd want to use it.

You're right that it doesn't need to be middleware, its quite likely I went middleware-crazy on that. Part of the reason for putting it there rather than inside the PylonsApp code that sets up the globals was so that it'd be easier to remove if you didn't want to use it, though a flag passed to PylonsApp could do that as well.

Would a flag to turn it off be preferable to just removing that line from middleware.py?

Cheers,
Ben

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to