Use the protocol as a key for caching

closes #313