Fast relation viewer (or relations caching)

In response to my post on Help site (http://help.openstreetmap.org/questions/9024/large-relations-slow-to-show-caching-a-solution) I would like to work on better relations viewing. Can someone give a hint where to start?

If you’d like to work on something related to the main site it’s better to ask on the rails-dev mailing list - most of the core developers don’t read this forum.