# Restoring default cache settings after node restart

**URL:** <https://discuss.elastic.co/t/restoring-default-cache-settings-after-node-restart/8314>\
**Category:** Elasticsearch\
**Created:** [July 4, 2012, 2:03pm UTC](https://discuss.elastic.co/t/restoring-default-cache-settings-after-node-restart/8314 "2012-07-04T14:03:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_J](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@Tim\_J](https://discuss.elastic.co/u/Tim_J)\
**Post date:** [July 4, 2012, 2:03pm UTC](https://discuss.elastic.co/t/restoring-default-cache-settings-after-node-restart/8314/1 "2012-07-04T14:03:15Z")

</div>

Hey folks,  
I've been playing around with cache settings recently, mainly related to  
the field cache, and I've been unable to figure out how to restore the  
defaults (e.g. unlimited). The docs seem to indicate that I should be able  
to set both index.cache.field.max\_size and index.cache.field.expire to -1  
to get the defaults. This works until I restart the node at which point I  
get an exception about "maximum size must not be negative" or a similar one  
for the expiration time and the index won't load.

The workaround seems to be to set both values to something other than -1  
(say 1 and 5m) at which point the index will load and then you can set them  
back to -1 again. Obviously you'll have the same problem next time you  
restart.

Am I using the wrong values here? If so, should there be some validation  
when the values are set in addition to when the index is loaded after a  
restart?

Thanks,  
-Tim

---

<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 6, 2017, 3:21am UTC](https://discuss.elastic.co/t/restoring-default-cache-settings-after-node-restart/8314/2 "2017-07-06T03:21:31Z")

</div>


