2010年10月22日星期五

Re: [fw-mvc] about Routes

Here's your problem: YOUR ROUTES ARE ALL THE SAME AND YOU HAVE 3000 OF

THEM! Every time someone accesses your site, the router has to go
through EACH DEFINITION to find the right one to use.

Define only a single route and use that:

routes.cates.route = "list/:id/:page"
routes.cates.defaults.module = "default"
routes.cates.defaults.controller = "list"
routes.cates.defaults.action = "index"
routes.cates.defaults.id = 1
routes.cates.defaults.page = 1
routes.cates.reqs.id = "\d+"
routes.cates.reqs.page = "\d+"

This will fix your problem.


On 10/22/2010 8:01 PM, Expertics wrote:
> Hi,
>
> I have 3000 definitions in my config.ini .
>
> routes.cates1.route = "list1/:page"
> routes.cates1.defaults.module = "default"
> routes.cates1.defaults.controller = "list"
> routes.cates1.defaults.action = "index"
> routes.cates1.defaults.id = 1
> routes.cates1.defaults.page = 1
> routes.cates1.reqs.page = "\d+"
>
> ....
> ....
>
> routes.cates3000.route = "list3000/:page"
> routes.cates3000.defaults.module = "default"
> routes.cates3000.defaults.controller = "list"
> routes.cates3000.defaults.action = "index"
> routes.cates3000.defaults.id = 3000
> routes.cates3000.defaults.page = 3000
> routes.cates3000.reqs.page = "\d+"
>
>
> I think my web site (it isn´t production) is slower than before. This
> is Okay or I need other solution.
>
> bye
>
>
> George
>
>

没有评论: