You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by gesellix <gi...@git.apache.org> on 2018/04/29 13:06:38 UTC

[GitHub] httpcomponents-client pull request #101: Ignore cached ETag and Last-Modifie...

GitHub user gesellix opened a pull request:

    https://github.com/apache/httpcomponents-client/pull/101

    Ignore cached ETag and Last-Modified headers of HEAD cache entries

    Since httpclient-cache 4.4 `HEAD` requests can be cached with a `null` response body. Subsequent `GET` requests to the same target then use the headers "If-None-Match" and "If-Modified-Since" to leverage caching via HTTP protocol. In that case a server can respond with status code 304 and an empty response body, which leads to an invalid cache entry.
    
    The issue seems to be introduced with PR #13. The repo https://github.com/gesellix/httpclient-cache-demo shows the behaviour for HttpClients 4.3, 4.4, and 4.5. 
    
    This PR, based on the 4.5.x tag, tries to recognise the described invalid state and suppresses caching on the HTTP layer, so that the server has to return the complete response.
    
    Signed-off-by: Tobias Gesellchen <to...@gesellix.de>


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gesellix/httpcomponents-client disable-cache-for-null-resource

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/httpcomponents-client/pull/101.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #101
    
----

----


---

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


[GitHub] httpcomponents-client issue #101: Ignore cached ETag and Last-Modified heade...

Posted by comcast-jonm <gi...@git.apache.org>.
Github user comcast-jonm commented on the issue:

    https://github.com/apache/httpcomponents-client/pull/101
  
    Yes, this approach is not the right one, as @fxbonnet mentioned. 👎 
    
    I'll comment on https://issues.apache.org/jira/browse/HTTPCLIENT-1920.



---

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


[GitHub] httpcomponents-client issue #101: Ignore cached ETag and Last-Modified heade...

Posted by gesellix <gi...@git.apache.org>.
Github user gesellix commented on the issue:

    https://github.com/apache/httpcomponents-client/pull/101
  
    We might consider not to add cache entries with a missing response body in the first place, which would obsolete PR #13 to some extend (initial `HEAD` requests for a specific target won't ever be cached anymore).



---

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


[GitHub] httpcomponents-client issue #101: Ignore cached ETag and Last-Modified heade...

Posted by fxbonnet <gi...@git.apache.org>.
Github user fxbonnet commented on the issue:

    https://github.com/apache/httpcomponents-client/pull/101
  
    @gesellix I don't think not caching head requests is an option. There are various use cases where this feature is a must-have.


---

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


[GitHub] httpcomponents-client issue #101: Ignore cached ETag and Last-Modified heade...

Posted by ok2c <gi...@git.apache.org>.
Github user ok2c commented on the issue:

    https://github.com/apache/httpcomponents-client/pull/101
  
    Related to HTTPCLIENT-1920


---

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


[GitHub] httpcomponents-client issue #101: Ignore cached ETag and Last-Modified heade...

Posted by gesellix <gi...@git.apache.org>.
Github user gesellix commented on the issue:

    https://github.com/apache/httpcomponents-client/pull/101
  
    The more recent Travis CI build https://travis-ci.org/apache/httpcomponents-client/builds/372677800 has been successful.



---

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


[GitHub] httpcomponents-client issue #101: Ignore cached ETag and Last-Modified heade...

Posted by gesellix <gi...@git.apache.org>.
Github user gesellix commented on the issue:

    https://github.com/apache/httpcomponents-client/pull/101
  
    @fxbonnet I agree. My comment was more like a thought about alternate options :)


---

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