# Class caching yields the wrong data

**URL:** <https://www.ruby-forum.com/t/class-caching-yields-the-wrong-data/109585>\
**Category:** Rails\
**Created:** [July 17, 2007, 3:40am UTC](https://www.ruby-forum.com/t/class-caching-yields-the-wrong-data/109585 "2007-07-17T03:40:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 17, 2007, 3:40am UTC](https://www.ruby-forum.com/t/class-caching-yields-the-wrong-data/109585/1 "2007-07-17T03:40:42Z")

</div>

In production (and in development, with environment config set to  
“config.cache\_classes = true”), sometimes the wrong object is  
associated with the wrong object because of caching.

I’d rather, however, not take a performance hit by turning caching  
completely off.

Is there a way to force a class to reload? I’ve tried using “reload”  
and “clear\_reloadable\_connections!()” …but perhaps I’m not using  
them correctly.

Thanks!  
Stephen
