thousands of urls in routes.php make the application slower? |
[eluser]eshban[/eluser]
Hi I want to use routes.php for url rewriting. I have a huge application which contains more than 7000 urls and still growing, so every url will be in route.php file. I need to ask, are these large number of url's make the routes.php file heavy which will actually slow down the application? Looking forward for best answers. Regards, Eshban
[eluser]John_Betong_002[/eluser]
[quote author="eshban" date="1311355246"]yes. Thats why I have written it here.[/quote] Can you give a small sample from your URLs. I am sure that by using the route wildcard features you could considerably reduce the route file size.
[eluser]Nemke[/eluser]
Maybe you should store you URL's in some MySQL table, and then extend core classes http://ellislab.com/codeigniter/user-gui...asses.html and make Router Class check your's MySQL table?
[eluser]Eric Barnes[/eluser]
I am sorry but 7000 routes is crazy and will be insane to manage. I think the structure of your application needs to be rethought.
[eluser]John Murowaniecki[/eluser]
If you need more aid for restructuring of your system I suggest that you replicate the production environment and create a development environment (which can be released so that someone can assist you by viewing the entire problem). If you need a help to do it you can also count on me (send a DM). Good luck!
[eluser]danmontgomery[/eluser]
routes are an array, which have to be loaded and parsed with every page request... So, yes, 7000 elements in that array will be slower than, say, 10 elements.
[eluser]n0xie[/eluser]
[quote author="noctrum" date="1312495452"]routes are an array, which have to be loaded and parsed with every page request... So, yes, 7000 elements in that array will be slower than, say, 10 elements.[/quote] Actually... When using APC the array will be precached, hence no disk seek is needed. So from a load time/ parsing point of view it shouldn't matter. Then again when it tries to actually match against this large dataset when it needs to route a request, then yes, it will take a lot longer. I'm pretty sure the OP's problem can be solved by using .htaccess rewrite rules, but since he has shown us no examples, it seems to me he has solved the problem already. |
Welcome Guest, Not a member yet? Register Sign In |