[patch] Caching of servername in mail.py slows down startup time
|Reported by:||Chris Beaven||Owned by:||Adrian Holovaty|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Especially when running the development server! Every time code changes it can take up to a couple of seconds to restart (before the patch in #3007 it was noticeably faster).
I wrote the initial change to cache the dns name, and while that's still a good idea it would be better to do it lazily instead. Patch attached.