Skip to main content
Feb 16, 2016 1:20 AM UTC
Question

ColdFusion Cache object keeps disappearing

Hi,

I recently started using ColdFusion cache (cachePut/cacheGet) in CF10 to store some objects (struct/array).  However, the objects disappear from the cache within a day or so and I have to re-create them.  The cache objects are used regularly so there is no idle time that would cause them to time out.  For good measure, I have also set the "eternal" property of the cache to true. 

Does this have anything to do with the cache limit settings (for component, query caching, etc) in the admin?  I would think not, but I am perplexed as to why my cache keeps getting reset.  Anything I am not doing?

Thank you!

    This topic is closed to new replies. Start a new post to keep the conversation going.

    4 replies

    Dave Ferguson
    Participating Frequently
    Feb 16, 2016 2:42 AM UTC

    In the ehcache.xml file you need to change the default cache time.   The file is in the  cfusion/lib directory.  At the end of the xml file in the defaultcache section change the timeToIdleSeconds and timeToLiveSeconds both to "0".  The current setting makes the cache timeout in a day.  Once you change the file restart CF and you should be good to go.  You may need to stop CF to edit the file in some occurances.

    HTH,

    --Dave

    Translate
    Feb 16, 2016 3:24 AM UTC

    Thanks.  I will give it a try.  I was under the impression that the default timeout in cacheput (according to the documentation) is forever.

    Translate
    Dave Ferguson
    Participating Frequently
    Feb 16, 2016 4:10 AM UTC

    Unfortunately the documentation is wrong.  The ehcache default is to not timeout but it was apparently changed.

    Translate