Caching aspect - how to create key from method name and arguments
I am creating an aspect to appl开发者_如何学Pythony to methods that checks the cache for a return value, and only permits procession onto the logic of the method if the cache is empty or stale.
I need to generate a cache key for the storage of this information that is unique to the method call for a given set of arguments. My initial hunch is to implement a key creation algorithm that takes the qualified method name and appends serialised argument information.
Is there a recognised approach to key creation under these circumstances?
精彩评论