Typically, I require a substantial retainer to be applied against final invoice. By substantial, I mean big enough to cover all the billings up to payment of the first invoice. Payment terms are always "Due on receipt of invoice." I am not in the no-interest short term unsecured loan business. This means:
1. I will not be upside down where I am owed money for work I have done.
2. I will not discover that the client does not have funds to pay me.
3. I will avoid potential clients with a strong propensity not to pay without investing much time.
4. I will avoid potential clients who will use me as a bank.
5. I will avoid potential clients who believe that since they did not build it, they should not have to pay.
The most significant characteristic of a good client is that they pay quickly and well. Here, "well" can mean a lot or regularly, but preferably both. Writing a check before we start is a good indicator.
There are exceptions of course. Bureaucratic organizations have their payment procedures. On the other hand, if the person who I am talking to cannot authorize a retainer, then I might not be talking to the right decision maker about the financial aspects of the contract.
Good luck.