cloudflare / worker-template-router

231 stars 85 forks source link

Is it really necessary to create a Router instance on each request?, I think is not #20

Closed ChStark closed 3 years ago

ChStark commented 4 years ago

Reading a little bit the Router code it seams a Router instance can be created once upon worker start and then call the Router#route method on each event

tomByrer commented 4 years ago

For some odd reason, I always assumed there was a new Chromium 'VM' (tab really) instance on every request anyhow? Or at least could be, since there could be load balancing, re-routing, etc.

PierBover commented 4 years ago

@ChStark have you tried that? Does it work?

ChStark commented 4 years ago

Yes I took it outside and it still worked

kristianfreeman commented 3 years ago

Closed via #35