# Generating routes on demand

**URL:** <https://www.ruby-forum.com/t/generating-routes-on-demand/162655>\
**Category:** Rails\
**Created:** [March 12, 2009, 2:18pm UTC](https://www.ruby-forum.com/t/generating-routes-on-demand/162655 "2009-03-12T14:18:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drogomir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/5fc32e/32.png) [@Drogomir](https://www.ruby-forum.com/u/Drogomir)\
**Post date:** [March 12, 2009, 2:18pm UTC](https://www.ruby-forum.com/t/generating-routes-on-demand/162655/1 "2009-03-12T14:18:57Z")

</div>

Hi,

I have problem with routes. It’s the big one (over 50 resources) and  
starting an app is a pain - 3-4 seconds. I’ve added :only and :except  
options where I could and it’s better than at the beginning but  
still… slow.

I use passenger to deploy apps, so fast boot is important. I thought  
that most of the routes are not used often anyway (especially those  
from admin/) and in most cases while instance is running (and while  
passenger stops app after 5 minute idle time) most of the routes are  
not used… Generation on demand would fix this problem.

For example: I call user\_path(@user) and it doesn’t exist so it’s  
generated and is available with next requests.

Is this doable? Or maybe there is some plugin which makes the trick?
