How would you design a resilient network layer for a mobile app, including retries and payload optimization?