Re: HttpCacheStorage#getEntry called twice on cache hit

2017-05-23 Thread Oleg Kalnichevski
On Thu, 2017-05-18 at 15:32 +, Leandro Nunes wrote: > Hi, > > I created this (https://github.com/apache/httpcomponents-client/pull/ > 77) pull request with a simple possible solution to this problem. It > would be awesome if you could please take a look and validate whether > the proposed fix

Re: HttpCacheStorage#getEntry called twice on cache hit

2017-05-18 Thread Leandro Nunes
Hi, I created this (https://github.com/apache/httpcomponents-client/pull/77) pull request with a simple possible solution to this problem. It would be awesome if you could please take a look and validate whether the proposed fix valid or not. I’m more than happy to change whatever you think is

Re: HttpCacheStorage#getEntry called twice on cache hit

2017-05-17 Thread Leandro Nunes
Thanks Oleg and Jon, Oleg, I didn’t see a problem with the implementation of the RFC. The result I get back is the one I was expecting (regarding actually calling the origin for the entity or returning the cached instance - without making the request to the origin). The problem has to do with c

Re: HttpCacheStorage#getEntry called twice on cache hit

2017-05-16 Thread Jon Moore
Yes, unfortunately I haven't had time to work on the caching module for several years, so I don't remember all the ins and outs of the implementation. However, Leandro, perhaps you could post the headers for the original request, the (cached) response, and then the subsequent request that gets a ca

Re: HttpCacheStorage#getEntry called twice on cache hit

2017-05-16 Thread Oleg Kalnichevski
On Tue, 2017-05-16 at 11:42 +, Leandro Nunes wrote: > I just noticed the caching implementation is calling getEntry method > twice when the entry is cached. I did some debugging and it looks > like the first one is related with flushing invalid entries and the > second call is related with actu

HttpCacheStorage#getEntry called twice on cache hit

2017-05-16 Thread Leandro Nunes
I just noticed the caching implementation is calling getEntry method twice when the entry is cached. I did some debugging and it looks like the first one is related with flushing invalid entries and the second call is related with actually serving the request. My question is wether this is the e