# Request cache can not be enabled successfully in java transport client

**URL:** <https://discuss.elastic.co/t/request-cache-can-not-be-enabled-successfully-in-java-transport-client/213118>\
**Category:** Elasticsearch\
**Created:** [December 27, 2019, 2:29am UTC](https://discuss.elastic.co/t/request-cache-can-not-be-enabled-successfully-in-java-transport-client/213118 "2019-12-27T02:29:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pphust](https://avatars.discourse-cdn.com/v4/letter/p/9fc29f/32.png) [@pphust](https://discuss.elastic.co/u/pphust)\
**Post date:** [December 27, 2019, 2:29am UTC](https://discuss.elastic.co/t/request-cache-can-not-be-enabled-successfully-in-java-transport-client/213118/1 "2019-12-27T02:29:08Z")

</div>

Hi,

I meet one strange problem in our es cluster.  
When I submit one http request through curl, or submit it through java rest client, the request cache works well and I can see "hit\_count" keep increasing when submitting same requests.

But when I use java transport client, it seems it never uses request cache even if I use `SearchRequestBuilder.setRequestCache(true)` to setup it. Anyone meet same problem and how can I resolve it?

Below is my working environment:  
Elasticsearch version: 5.4.3  
Plugins installed: N/A  
JVM version: 1.8.0\_11  
OS version: 3.10.0-693.5.2.el7

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 24, 2020, 2:29am UTC](https://discuss.elastic.co/t/request-cache-can-not-be-enabled-successfully-in-java-transport-client/213118/2 "2020-01-24T02:29:15Z")

</div>

Closed on January 24, 2020, 2:29am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
