From d090870651ca6db3cd9ce75559c865c78a7bf137 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Fri, 28 Jun 2024 14:17:37 +0200 Subject: [PATCH] Change default HTTP client cache settings --- src/main/java/org/jivesoftware/webservices/RestClient.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jivesoftware/webservices/RestClient.java b/src/main/java/org/jivesoftware/webservices/RestClient.java index 3eb3c950..498d6d68 100644 --- a/src/main/java/org/jivesoftware/webservices/RestClient.java +++ b/src/main/java/org/jivesoftware/webservices/RestClient.java @@ -17,7 +17,10 @@ public class RestClient { private static final Logger Log = LoggerFactory.getLogger( RestClient.class ); - private static final CacheConfig cacheConfig = CacheConfig.DEFAULT; + private static final CacheConfig cacheConfig = CacheConfig.custom() + .setMaxObjectSize(250_000L) // The RSS feeds' JSON is easily 100k. + .setMaxCacheEntries(250) // prevent the default amount of 1000 entries to be cached, when they _can_ be 250k each. + .build(); public JSONObject get(String url) { JSONObject result = null;