The shorter the hard effort, the shorter the rest period should be.

I only intentionally do intervals on the indoor trainer. (When I'm riding outside, I let the hills create them for me, or circumstances like cars waiting behind me to pass so I ride as fast as I can until I reach an area where they can pass safely.) Some sets will be pretty short, like 30 seconds on, 30 seconds rest, repeat 5 times, then rest for 2 minutes.

Some sets are longer, like 5 minutes hard effort. For those, the rest period is 2 minutes.