Seems Laravel allows caching of PHP queries and database queries using file, database (database table), memcached or redis. For this you can use specific functions. PHP OpCache pre compiling of scripts is a separate thing altogether.
Apr 22, 2019
3
Level 6
PHP OpCache CACHE_DRIVER / APC
We are currently using CACHE_DRIVER=file in our .env which means we are using the Laravel Default Caching. We also have PHP Opcache up:
forge@w-1:~/domain.com/current$ php artisan opcache:status
General:
+---------------------+-------+
| key | value |
+---------------------+-------+
| opcache_enabled | 1 |
| cache_full | |
| restart_pending | |
| restart_in_progress | |
+---------------------+-------+
Memory usage:
+---------------------------+-----------+
| key | value |
+---------------------------+-----------+
| used_memory | 25.39 MB |
| free_memory | 102.61 MB |
| wasted_memory | 0.00 MB |
| current_wasted_percentage | 0 |
+---------------------------+-----------+
Interned strings usage:
+-------------------+---------+
| key | value |
+-------------------+---------+
| buffer_size | 8.00 MB |
| used_memory | 2.14 MB |
| free_memory | 5.86 MB |
| number_of_strings | 35473 |
+-------------------+---------+
Statistics:
+----------------------+---------------------+
| option | value |
+----------------------+---------------------+
| num_cached_scripts | 555 |
| num_cached_keys | 1058 |
| max_cached_keys | 16229 |
| hits | 39858 |
| start_time | 2019-04-23 05:39:41 |
| last_restart_time | 1970-01-01 01:00:00 |
| oom_restarts | 0 |
| hash_restarts | 0 |
| manual_restarts | 0 |
| misses | 565 |
| blacklist_misses | 0 |
| blacklist_miss_ratio | 0 |
| opcache_hit_rate | 98.602280879697 |
+----------------------+---------------------+
Funnily enough Forge states it is not active in its Dashboard.. Odd.
Will Bytecode precompiling with OpCache take place with CACHE_DRIVER=file? Will it work either way?
Please or to participate in this conversation.