I
I
Igor Samokhin2016-03-27 20:07:50
PHP
Igor Samokhin, 2016-03-27 20:07:50

What is the logic behind how php opCache works?

Hello,
who can explain how php opCache works? No, I know that it stores the byte code in memory, but if I have a php script that looks different depending on the authorized user, which means that this is a unique byte code for each user, then php opCache will store a huge amount of compiled code in mind?
The memory will quickly run out and what is the point of opCache then? Can someone explain with an example..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-03-27
@grigor007

there is a php script that looks different depending on the authorized user

What does it look like physically?
The result of the script - yes, looks different for each user.
So the cache bytecode does not cache it, but the page generation algorithms themselves.
Roughly speaking, time is saved for parsing a file, building a tree of operations, calculating expressions consisting of constants, and so on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question