Joe Swindell
Joe Swindell

Reputation: 671

How are php functions processed and shared on a web server?

When a client request a page which contains some php functions, say functions.php, the server processes the file and presents the page. If a second user request the same page, does, or can the web server share a cached version, or anything of that sort with the second user?

User 1 -> index.php -> includes -> functions.php

Server <- functions.php

User 2 -> index.php -> includes -> functions.php

Server <- cached functions.php

Or, will the server ALWAYS process a new version on request?

Upvotes: 1

Views: 305

Answers (1)

Marc B
Marc B

Reputation: 360742

Without any kind of PHP opcode cache (e.g. APC), the only thing cached between requests is the code of the php script in the server's disk cache. Every PHP request is basically completely independent of every other request.

Two different requests for the same script will trigger two different compilation/execution phases of the same code.

Upvotes: 2

Related Questions