clear cache when it gets too big
ping the server to know if we are disconnected