How to use opcache_compile_file () in PHP?

I understand how caching works and how it improves performance. I couldn't find anywhere on the internet that had examples of this. What are the best practices?

Internally, if the function opcache_compile_file()

is being executed, I assume it is checking if the file is already cached, and if so, then quickly move on to the next statement (or the performance gain will be lost) is a bit of a rhetorical question.

Finally, I'm using Dependency Injection, and PHP seems to already do a good job of caching functions and classes even when using DI and instantiating on the fly.

Is opcache_compile_file () required?

+3


source to share


1 answer


Is opcache_compile_file () required?



No, you don't have to worry about it. The opcache operation works automatically, you have nothing to do.

+1


source







All Articles