[eluser]Addow[/eluser]
Hi ranjudsokomora,
Wow, that was a quick cache integration. I did not expect to results this fast. I think you did a great job. Hope other people will use this too. The benchmarks are quite similar to the other approach, so time is no longer an issue.
I really like the way you customized it. I noticed a little typo (
Dynomite route) by the way

Good job!
In the meanwhile I build my own route cache system, because I use language based URI's, the DB cached approach did not solve all my issues

Currently I use your non-hook approach, but I replaced the DB input by a language based input. For every language i wrote a
nav_lang.php file which contains language entries for every method in a controller or a controller itself. I can use these language entries when I display a layout for a certain language.
For example.
Code:
$lang['nav_home'] = "home";
$lang['nav_home_online'] = "home/online";
$lang['nav_news'] = "news";
$lang['nav_news_article'] = "news/article";
My cache generator scrolls through all
nav_lang.php files, one for every language, then generates a route for every entry by reversing the order and replacing the underscores by forward slashes and some other parse stuff.
This is the result after generating the routes cache file (english/dutch/french/german):
Code:
// Lang routes for controller/method: [home]
$route['[a-z]{2}/home'] = "home";
$route['[a-z]{2}/accueil'] = "home";
$route['[a-z]{2}/start'] = "home";
// Lang routes for controller/method: [home/online]
$route['[a-z]{2}/home/online/(.+)'] = "home/online/$1";
$route['[a-z]{2}/accueil/online/(.+)'] = "home/online/$1";
$route['[a-z]{2}/start/online/(.+)'] = "home/online/$1";
// Lang routes for controller/method: [news]
$route['[a-z]{2}/nieuws'] = "news";
$route['[a-z]{2}/news'] = "news";
$route['[a-z]{2}/actualite'] = "news";
$route['[a-z]{2}/nachrichten'] = "news";
// Lang routes for controller/method: [news/article]
$route['[a-z]{2}/nieuws/artikel/(.+)'] = "news/article/$1";
$route['[a-z]{2}/news/article/(.+)'] = "news/article/$1";
$route['[a-z]{2}/actualite/article/(.+)'] = "news/article/$1";
$route['[a-z]{2}/nachrichten/artikel/(.+)'] = "news/article/$1";
Anyway, this was just an illustration of my situation. Great work and I support your approach next to neillyons.info's. Well done.