You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Jon Moore (JIRA)" <ji...@apache.org> on 2013/07/30 16:35:48 UTC

[jira] [Commented] (HTTPCLIENT-1384) Expose CacheInvalidator in CachingHttpClientBuilder

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

Jon Moore commented on HTTPCLIENT-1384:
---------------------------------------

I think exposing a cache invalidation interface of some sort sounds reasonable. If I recall correctly, though, the invalidations you describe here only happen if the origin returns a non-error (something other than 4XX or 5XX), specifically to prevent the type of attack you describe. Can you write a test (perhaps as a patch to TestProtocolRecommendations) that demonstrates that the current implementation flushes the cache on a POST where the origin returns, say, a 403?

                
> Expose CacheInvalidator in CachingHttpClientBuilder
> ---------------------------------------------------
>
>                 Key: HTTPCLIENT-1384
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1384
>             Project: HttpComponents HttpClient
>          Issue Type: Wish
>          Components: HttpCache
>    Affects Versions: 4.2.5, 4.3 Beta2
>            Reporter: Nicolas Richeton
>
> There is currently no way to customize the CacheInvalidator. Could it be possible to allow setting a  CacheInvalidator in CachingHttpClientBuilder (eg. CachingHttpClientBuilder#setCacheInvalidator())
> Our use case : 
> - HttpClientCache is used in a Caching Reverse Proxy (shared cache, exposed to public connections)
> - We have to ensure the cache cannot be flush by a random user.  
> - The default CacheInvalidator flushes all variants of an URI when receiving anything other than GET, HEAD (compliant with RFC)
> - It is currently possible for a user to flush the whole cache by sending POST requests of all uri (this may be harmful even only on a home page). 
> While it is not RFC-compliant, we need at least the ability to prevent invalidation in CacheInvalidator#flushInvalidatedCacheEntriesFor and/or control invalidation with custom method  (PURGE) and other criteria (like remote ip)
> The same applies to HttpClientCache 4.2.5: CachingHttpClient which does not allow provide a custom CacheInvalidator
> Would this sound ok for you ? 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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