Laravel OPcache Package

Laravel OPcache Package

PHP, since version 5.5, comes bundled with OPcache which improves performance. Here is how PHP documentation explains it:

OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.

One of the drawbacks to implementing OPcache is that you have to clear the cache every time you change any PHP code. Because of this, the team at Appstract has created a Laravel Artisan package that gives you quick and easy commands for OPcache. Here are a few usage examples:

Clear OPcache:

php artisan opcache:clear

Show OPcache config:

php artisan opcache:config

Show OPcache status:

php artisan opcache:status

Pre-compile your application code (experimental, test before you deploy):

php artisan opcache:optimize

To learn more about this package check out the GitHub Repository which includes all the instructions and everything you’ll need to get started.

Filed in: Laravel Packages / Artisan / OPcache


Join 31,000+ others and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Senior Full Stack PHP Developer (Laravel)
Senior Laravel Developer
Senior Full-Stack Engineer
Developers for B2B eCommerce SaaS, AWS serverless, Laravel, Vue, Python
Remote, full time EU only
ES Tech Group
Senior PHP Developer (Laravel)
The Interaction Design Foundation