Re: Revisiting lazy middleware initialization

2016-03-27 Thread Ben Liyanage
I'm not currently suffering from this. In the past with .NET I have definitely suffered from some long memory loads of DLLs. The stuff I'm doing now is a lot of back end batch processing where how fast the initial response is is pretty negligible compared to a process that lasts for 10+ minutes.

Re: Revisiting lazy middleware initialization

2016-03-27 Thread Shai Berger
Fred, The thread (and Ben) is talking about "lazy load" in the sense of "wait until the first request comes in, only then load things". This used to be the way all of Django behaved until 1.7 and the app refactor. These days, it only applies to some parts -- middleware is the topic of this thre

Re: Revisiting lazy middleware initialization

2016-03-27 Thread Fred Stluka
Ben, If lazy loading is causing you problems, here's good info on how to force Django to load everything up front, by calling select_related() and prefetch_related() in cases where you need to. And also how to make that the default via use_for_related_fields and custom managers: - https://docs.d

Re: Revisiting lazy middleware initialization

2016-03-27 Thread bliyanage
I'm not too familiar with the code you're referencing, but I'm personally really annoyed by lazy loading. It has a tendency to make selenium tests timeout inconsistently in CI, as well as give the impression to my bosses that the app is slow rather than just the first load which is usually what