Andreas
Andreas

Reputation: 7268

One million pages in Angular SPA

I have a webshop with lots of products that i plan to migrate to an angular SPA application with ngRoute and html5 mode. I have implemented a solution where i get some of my routes from the server as a json object but if I were to scale this up to 127630 pages that I have in the product-catalog the json would be massive and would not work.

How would you solve it? Can I prime the route-config with some common pages like support and checkout and then extend the ngRoute-config with ajax on each route change that is not found?

Upvotes: 0

Views: 70

Answers (1)

Ali Bahrami
Ali Bahrami

Reputation: 503

If your server act Restful, you can build some categories like "#/electronics" and "#/foods" etc, and then with $http calls get products, instead of making a route for every product. Tell me if you need code or example.

Upvotes: 1

Related Questions