You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (Jira)" <ji...@apache.org> on 2025/11/13 10:33:00 UTC

[jira] [Commented] (HTTPCLIENT-2406) MemcachedHttpCacheStorage always stores data in remote store with zero expiration.

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

Oleg Kalnichevski commented on HTTPCLIENT-2406:
-----------------------------------------------

[~akasham1992] The original contributor of theĀ `MemcachedHttpCacheStorage` has long left the project but I presume that behavior was intentional as it aligns with the behavior of other cache storage implementations. So, I do not think this is a bug.

You are welcome to make this behavior configurable, though, by contributing proposed changes as a GitHub pull request.

Oleg 

> 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: Bug
>          Components: HttpCache, HttpClient (classic)
>            Reporter: Akash
>            Priority: Major
>
> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org