# Serious problem with caching with multiple mongrels?

**URL:** <https://www.ruby-forum.com/t/serious-problem-with-caching-with-multiple-mongrels/117386>\
**Category:** Rails\
**Created:** [October 16, 2007, 3:43pm UTC](https://www.ruby-forum.com/t/serious-problem-with-caching-with-multiple-mongrels/117386 "2007-10-16T15:43:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![weepy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/5f8ce5/32.png) [@weepy](https://www.ruby-forum.com/u/weepy)\
**Post date:** [October 16, 2007, 3:43pm UTC](https://www.ruby-forum.com/t/serious-problem-with-caching-with-multiple-mongrels/117386/1 "2007-10-16T15:43:08Z")

</div>

Hi

I ran into what seemed to be a very serious problem with the way  
caching works. However it seems so serious that I wonder if I’m  
missing something very obvious !

Essentially if you use a filestore and a fragment cache with multiple  
mongrels and named routes you get key names like :

/path/to/cache/128.0.0.1.8000/users/json  
/path/to/cache/128.0.0.1.8001/users/json  
/path/to/cache/128.0.0.1.8003/users/json

Notice that different mongrels get a different directory. This is  
because fragment key is calculated with “url\_for”.

The problem with this is obvious, since the fragments are not  
application wide and it depends which mongrel server the request is on  
to which folder it will look in.

I managed to fix it by using a string rather than a named route, but  
I’m still fairly confused. I wonder whether its a feature, but I can’t  
see what it would be useful for!

Jonah
