You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
List<Cookie> result = cookieJar.entrySet().stream().filter(pair -> {
the look up over cookies traverses all entries in the map. The side effect to clean all expired cookies traverses the list again. The cost for algorithm scales with the number of cookies.
In our project we had to disable the cookie store, i.e. new DefaultAsyncHttpClientConfig.Builder() .setCookieStore(null) ... .build()
Maybe you could rewrite the function using another data structure that facilitates the look up for candidate cookies and then make a lazy removal of the expired candidates, or remove expired cookies asynchronously and periodically.
The text was updated successfully, but these errors were encountered:
Changes:
Segmented map based on domain names. So instead of traversing all the domains it traverses the domains that are of interest.
Use NettyTimer to clean up the expired cookies asynchronously. The timer task that provides this functionality is CookieEvictionTask.
In
async-http-client/client/src/main/java/org/asynchttpclient/cookie/ThreadSafeCookieStore.java
Line 160 in 365c1e6
In our project we had to disable the cookie store, i.e.
new DefaultAsyncHttpClientConfig.Builder() .setCookieStore(null) ... .build()
Maybe you could rewrite the function using another data structure that facilitates the look up for candidate cookies and then make a lazy removal of the expired candidates, or remove expired cookies asynchronously and periodically.
The text was updated successfully, but these errors were encountered: