hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HTTPCLIENT-1460) Cached files would be deleted after CloseableHttpClient being closed.
Date Thu, 13 Feb 2014 12:49:20 GMT

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

Oleg Kalnichevski edited comment on HTTPCLIENT-1460 at 2/13/14 12:49 PM:
-------------------------------------------------------------------------

Yang
It is too late to change the default behavior of caching HTTP clients in 4.3. One can, however,
override the default behavior by providing a custom resource factory

{code:java}
CloseableHttpClient client = CachingHttpClients.custom()
        .setResourceFactory(new FileResourceFactory(new File("my-cache")))
        .build();
{code}


was (Author: olegk):
Yang
It is too late the default behavior of caching HTTP clients in 4.3. One can, however, override
the default behavior by providing a custom resource factory

{code:java}
CloseableHttpClient client = CachingHttpClients.custom()
        .setResourceFactory(new FileResourceFactory(new File("my-cache")))
        .build();
{code}

> Cached files would be deleted after CloseableHttpClient being closed.
> ---------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1460
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1460
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpCache
>    Affects Versions: 4.3.2
>            Reporter: Yang Bo
>
> I created a `CloseableHttpClient` from `CachingHttpClientBuilder`. I assigned a directory
for the `CloseableHttpClient`'s cacheDir.
> The `CloseableHttpClient` worked well for processing requests with cache. But after `CloseableHttpClient.close()`
invoked, all cached files were deleted. Therefore, new `CloseableHttpClient` in new JVM cannot
reuse original cache. 
> This behavior is different from browsers or JDK's http clients.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

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


Mime
View raw message