flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.62k stars 409 forks source link

Performance: Cached Routes + opcache #462

Closed fp07 closed 7 months ago

fp07 commented 2 years ago

Is it possible to cache the current routes? For max performance?

Examples:

  1. https://github.com/nikic/FastRoute#caching
  2. https://github.com/laravel/framework/blob/8.x/src/Illuminate/Foundation/Console/RouteCacheCommand.php
fp07 commented 2 years ago

Any suggestion @mikecao?

magikstm commented 2 years ago

Opcache should work with Flight.

Flight is really light.

Other things such as database or dynamic content would probably be the performance bottleneck.

n0nag0n commented 7 months ago

If you have a large amount of routes, then caching is beneficial. If you only have a couple dozen, it's basically worthless. When you have 100s of routes then caching becomes amazing!

Closing for now.