Add support for custom timeout

Very useful for multiple servers with an independent/not synced cache.