Fixed: Delete file from opcode cache when needed
Fixed: Avoid to write config cache file when not necessary
(cherry picked from commit 7cf04f5)
(cherry picked from commit 8e6e3f8)