Reputation: 2792
I was not able to find an answer to my question in the docs or by a few hours of googling.
Essentially, it all boils down to whether this code can be cached by OPcache including the json
file itself:
<?php
$array = json_decode(file_get_contents('./test.json'), true);
Upvotes: 0
Views: 972
Reputation: 151
No, OPcache is only caching you precompiled script in memory so PHP does not need to read and parse it on every page request.
The result of your code, like the response of your file_get_contents()-call, is not cached by OPcache.
Upvotes: 2