# What kind of cache should i use?

**URL:** https://discuss.elastic.co/t/what-kind-of-cache-should-i-use/52046
**Category:** Elasticsearch
**Created:** [June 7, 2016, 9:59am UTC](https://discuss.elastic.co/t/what-kind-of-cache-should-i-use/52046 "2016-06-07T09:59:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![eprst](https://avatars.discourse-cdn.com/v4/letter/e/a6a055/32.png) [@eprst](https://discuss.elastic.co/u/eprst)
#### Post date: [June 7, 2016, 9:59am UTC](https://discuss.elastic.co/t/what-kind-of-cache-should-i-use/52046/1 "2016-06-07T09:59:08Z")

</div>

i have about 10M docs in index and update rate about 3 requests per second. i want to know should i use query or request caches or they will be invalidated all the time. Also i use some term filter by for particluar fields in my queries. let assume it is cached. If i change documents having another value for that field, will this cache be also invalidated?

---

<div class="post-metadata">

### Author: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [June 7, 2016, 11:37am UTC](https://discuss.elastic.co/t/what-kind-of-cache-should-i-use/52046/2 "2016-06-07T11:37:30Z")

</div>

The filter cache is per segment so it should kick in quite well for you  
automatically. Just make sure to put the things you want to cache in  
constant score queries or the filter clause of the bool query.

The request cache is for the whole index so it likely won't help unless you  
have two indexes, one that you don't update frequently and one that you do.  
I believe this cache is disabled by default in 2.x. You should do some  
research if you think it will help you.

---

<div class="post-metadata">

### Author: ![eprst](https://avatars.discourse-cdn.com/v4/letter/e/a6a055/32.png) [@eprst](https://discuss.elastic.co/u/eprst)
#### Post date: [June 7, 2016, 2:51pm UTC](https://discuss.elastic.co/t/what-kind-of-cache-should-i-use/52046/3 "2016-06-07T14:51:04Z")

</div>

yes it will thx, i didn't know it is per segment

---

<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: [July 5, 2017, 10:45pm UTC](https://discuss.elastic.co/t/what-kind-of-cache-should-i-use/52046/4 "2017-07-05T22:45:35Z")

</div>


