Added caching

Port of symfony-cmf/RoutingAutoBundle#78
You used a CircularReference exception in another PR, should this be used here?