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 :
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!
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!
For when the host includes scoping information, like:
The problem here seems to be that the reverse mapping is not setup
correctly, such that Rails thinks that the host is localhost, instead
of the external host. This will be a problem whenever url_for is used
to create complete URLs and not just paths.
I think Koz meant that url_for() helper would be having problems. If you’re just using path helpers (like person_path(@person)) or url_for with ‘:only_path => true’ then you may not be seeing the errors.
Try putting a link to url_for(:controller => ‘users’) on your production site and see what pops up.
The X-Forwarded-For header needs to be set by your world-facing server (e.g. Apache, Nginx).