hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Moore (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1153) org.apache.http.impl.client.cache.memcached.MemcachedHttpCacheStorage uses URL as cache key - shouldn't.
Date Tue, 17 Jan 2012 17:19:39 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13187812#comment-13187812

Jon Moore commented on HTTPCLIENT-1153:

Ok, just checked in the implementation here. Worth discussing: I ended up deprecating one
of the existing constructors (one that took a custom serializer) because I had to change the
serialization mechanism to accommodate fixing this bug. I somewhat suspect few folks would
have been using custom serializers anyway, but there is a new constructor and some new interfaces
that can be implemented if custom serialization is still desired.

I chose SHA-256 as the default hashing scheme here. Do you think it is worth implementing
fallback algorithms based on SHA-1 or MD5? I'm somewhat inclined to just let others contribute
them if desired. The current default scheme with SHA-256 essentially resorts to not caching
at all if it can't find a SHA-256 algorithm, which might not be great for a default. Falling
back to a weaker algorithm is probably not hard, so perhaps I'll look at that next.

At any rate, the KeyHashingScheme interface should let us also provide a prefix-naming scheme
to solve HTTPCLIENT-1154 as well.

@Clinton: does this work for you?
> org.apache.http.impl.client.cache.memcached.MemcachedHttpCacheStorage uses URL as cache
key - shouldn't.
> --------------------------------------------------------------------------------------------------------
>                 Key: HTTPCLIENT-1153
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1153
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.1.1, 4.1.2
>            Reporter: Clinton Nielsen
>            Assignee: Jon Moore
>             Fix For: 4.1.3, 4.2 Alpha2
> Spy memcached has 250 defined as max key length:
> http://dustin.github.com/java-memcached-client/apidocs/constant-values.html#net.spy.memcached.MemcachedClientIF.MAX_KEY_LENGTH
> URLs can be (and often are) much longer than 250 characters.
> URLs should be hashed before being used as keys.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message