
Business Intelligence as a Service
Try PlusClouds Eaglet service and find high quality B2B hot leads and opportunites with AI support.
Laravel Octane allows you to serve your Laravel application using a powerful Swoole and/or Roadrunner Application Server for PHP. Laravel Octane starts your application in a powerful and optimized manner, retains it in memory for specific areas, cleans up object states, and manages object instances between requests.
Laravel Octane Original Documentation
Normally, the application and all objects are loaded multiple times for each request. With Laravel Octane, the application and object models are shared between requests. This means that the developer only needs to load certain objects once (note that some are loaded once at boot time), and in this case, Laravel Octane helps manage the states of the objects.
We are installing the Laravel installer
composer global require laravel/installer
We are creating a new Laravel project
laravel new laravel-octane
We enter the directory where our project is located
cd laravel-octane
We are installing our package via Composer
composer require laravel/octane
We are loading our package
php artisan octane:install
php artisan octane:start --port=8002
Yes, our application is now running on Octane. Octane begins to listen to and cache the general PHP core. It should be noted here that since Octane does not know about your dynamic changes, you can only notify these using the Cache Facade.
Cache::driver('octane')->put('test','test')
We have currently started our application on port 8002. However, what we should know here is that you must log in through the port where Laravel is running directly, not through php-fpm. Otherwise, Octane will not work.
As can be seen, there is a difference of up to 4 times in between.
If you are a journalist, who has desire to dig deep in topics related to businesses and sectors, we want to work with you!
With the AutoQuill tool that PlusClouds has started to offer to its affiliate partners, content creators will be able to sell with a single click. Let us show you how you can get your share of this revolution.