lundi 9 novembre 2015

Does 100s of routes in ember affect performance of app

I am trying to create a product catalog application in emberjs with a Ruby on Rails backend serving all the product information.

In order to be a good SEO citizen and overall Google friendly I want to create routes in ember that are very descriptive. To do this I have chosen to use 2 properties that each product has. For example I chose colour and shape therefore I want to create routes that appear like this in the URL

http://ift.tt/1PkD0ao
http://ift.tt/1iNRUaZ

Notice that the colour and the shape can be in either order so to achieve this I would need to create double the amount of routes to accommodate for the reverse pair.

What I have so far is an excessive number of routes that look like such:

this.route('red.square',  { path: '/products/red/square'  });
this.route('red.circle',  { path: '/products/red/circle'  });
this.route('blue.square', { path: '/products/blue/square' });
this.route('blue.circle', { path: '/products/blue/circle' });
this.route('square.red',  { path: '/products/square/red'  });
this.route('circle.red',  { path: '/products/circle/red'  });
this.route('square.blue', { path: '/products/square/blue' });
this.route('circle.blue', { path: '/products/circle/blue' });
...
...

I could potentially end up with 100s of routes in my ember router and this seems just silly. Does anybody know if this will affect performance? And ultimately are there any better ways to accomplish what I want?

I have toyed with the idea of using dynamic segments. Does this sound like a more feasible approach?




Aucun commentaire:

Enregistrer un commentaire