# Will the result getting by id be cached or not?

**URL:** <https://discuss.elastic.co/t/will-the-result-getting-by-id-be-cached-or-not/43185>\
**Category:** Elasticsearch\
**Created:** [March 2, 2016, 2:29am UTC](https://discuss.elastic.co/t/will-the-result-getting-by-id-be-cached-or-not/43185 "2016-03-02T02:29:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![makeyang](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@makeyang](https://discuss.elastic.co/u/makeyang)\
**Post date:** [March 2, 2016, 2:29am UTC](https://discuss.elastic.co/t/will-the-result-getting-by-id-be-cached-or-not/43185/1 "2016-03-02T02:29:18Z")

</div>

I'll use get by id a lot and I wonder if it is cached or not?  
if not, is there a way to achieve so without loseing real time capibility?

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [March 2, 2016, 2:40am UTC](https://discuss.elastic.co/t/will-the-result-getting-by-id-be-cached-or-not/43185/2 "2016-03-02T02:40:07Z")

</div>

No, get-by-id isn't cached explicitly by Elasticsearch. The segments holding the documents being fetched may well be cached in the OS filesystem cached if they are used repeatedly, but that's not an explicit cache that we control.

ES doesn't cache get-by-id because the operation is very fast, and caching the results would likely not help at all (or make things worse).

---

<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, 11:12pm UTC](https://discuss.elastic.co/t/will-the-result-getting-by-id-be-cached-or-not/43185/3 "2017-07-05T23:12:14Z")

</div>


