Re: [Httplib2-discuss] Non-opaque cache keys
Status: Beta
Brought to you by:
jcgregorio
From: Sam R. <ru...@in...> - 2006-11-15 23:04:41
|
Joe Gregorio wrote: > On 11/14/06, Sam Ruby <ru...@in...> wrote: >> It looks like the current implementation takes the md5 of a somewhat >> normalized URI and passes that as a key to the cache. >> >> For debug-ability and to increase the potential for integration with >> other subsystems, I'd like to suggest that this be changed to pass >> either the original URI unaltered or a normalized URI with the logic to >> do the normalization refactored out into a separate function. > > This is a great idea, I was frankly jealous when I looked at the > Venus cache and saw that it was filled with non-opaque named > files. :-) >> Either way, the current FileCache could do the remaining >> normalization/hashing of the key. Other storage systems could either >> use the key as is, or could employ a different hash mechanism. > > That works for me, shouldn't take long to implement. The attached patch does not break any existing unit tests. This does open up the question as to what normalization should be done. You are welcome to any or all of the code and unit tests mentioned here: http://www.intertwingly.net/blog/2004/08/04/Urlnorm > Thanks, > -joe - Sam Ruby |