# Fragment Caching - happening twice

**URL:** <https://www.ruby-forum.com/t/fragment-caching-happening-twice/105666>\
**Category:** Rails\
**Created:** [June 1, 2007, 6:01am UTC](https://www.ruby-forum.com/t/fragment-caching-happening-twice/105666 "2007-06-01T06:01:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![raghus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@raghus](https://www.ruby-forum.com/u/raghus)\
**Post date:** [June 1, 2007, 6:01am UTC](https://www.ruby-forum.com/t/fragment-caching-happening-twice/105666/1 "2007-06-01T06:01:48Z")

</div>

I am using fragment caching - the cache gets stored under RAILS\_ROOT/  
tmp/cache/www.mysite.com but if I go to [http://mysite.com](http://mysite.com) (no www)  
then a _second_ cache gets stored at RAILS\_ROOT/tmp/cache/mysite.com -  
from this point on the cache is hit but I end up with 2X the DB hits I  
really need. How can I avoid this?

Also where can I configure the fragment cache location - I was  
thinking of putting it under RAILS\_ROOT/public

Thanks
