Is there any way to reduce / eliminate the lag that is introduced into the app when using Server Modules? I had been building an app that previously loaded very quickly, but after using a Server Module, it takes several seconds to start up and I get the spinning circle animation until then.
If you do a forum search you’ll find a lot of similar posts about optimizing apps, and most of those have to do with server modules. Without seeing any sample code it’s hard to give specific advice, so the general advice is to make as few server calls as possible. For example, if you need to do three things on the server as part of starting up the app, do those three things in a single server call.
This (what Jeff said) remains the best advice. I’ve developed a practice of quickly doodle my apps and using multiple functions for things I think of and then working a second pass where I combine to single calls, push some things to background, use Anvil.Labs async and move some things to Globals.
I find the fast doodle approach really helpful as when you start to drop stop and start timers on the debug it prompts you on which individual functions to optimise while combining.
It is true that there’s a huge difference if you have persistent server though.