[
https://issues.apache.org/jira/browse/HTTPCLIENT-2406?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Oleg Kalnichevski resolved HTTPCLIENT-2406.
-------------------------------------------
Fix Version/s: 5.6-alpha2
Resolution: Fixed
> MemcachedHttpCacheStorage always stores data in remote store with zero
> expiration.
> ----------------------------------------------------------------------------------
>
> Key: HTTPCLIENT-2406
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2406
> Project: HttpComponents HttpClient
> Issue Type: Improvement
> Components: HttpCache, HttpClient (classic)
> Reporter: Akash
> Priority: Minor
> Fix For: 5.6-alpha2
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> MemcachedHttpCacheStorage today calls remote cache store with "0" TTL
> indicating the remote cache to never clean up the cached data. Hence the
> remote cache memory is filling up over a period of time without any sort of
> clean up since the TTL is 0.
> {code:java}
> @Override
> protected void store(final String storageKey, final byte[] storageObject)
> throws ResourceIOException {
> try {
> client.set(storageKey, 0, storageObject);
> } catch (final CancellationException ex) {
> throw new MemcachedOperationCancellationException(ex);
> }
> } {code}
> From what I can tell, this is implemented this way for a long time now, is
> this intentional ? if not, do you consider it as a bug?
> Shouldn't the TTL sent as part of the response be used during this call?
> https://github.com/apache/httpcomponents-client/blob/master/httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/memcached/MemcachedHttpCacheStorage.java#L174
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]