SEEDCODE has a series of great tips for optimizing WebDirect in FileMaker 13. Here's the latest:
Since layout redraw is one of the slowest things a Web Direct (WD) layout can do, you’ll want to do whatever you can to minimize those redraws (which can appear your users as flashing or as a spinning busy icons).
So, “do as little as possible”. This often means wrapping your commands in If() statements to see if they’re necessary. We don’t need to do this in Pro because we don’t notice things like “Revert Record” if they’re not needed. But in Web Direct, you really see Revert Record even if there is no record to revert.
Interestingly, “Commit Record” doesn’t cause a layout redraw when called unnecessarily.
There's more at the link.