CodeIgniter Forums
Note on using the new opcache - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31)
+--- Thread: Note on using the new opcache (/showthread.php?tid=73942)



Note on using the new opcache - InsiteFX - 06-26-2019

If you are using the new opcache in php 7 etc;

You will need to create a file to clear the cache or your development updates will not
work. Everything will be pulled from the cache so when making changes you will need
to run the below file first.

flush_opcache.php

PHP Code:
<?php

opcache_reset
(); 

Place it in the root along with index.php


RE: Note on using the new opcache - dave friend - 06-26-2019

(06-26-2019, 03:08 AM)InsiteFX Wrote: If you are using the new opcache in php 7 etc;

You will need to create a file to clear the cache or your development updates will not
work. Everything will be pulled from the cache so when making changes you will need
to run the below file first.

flush_opcache.php

PHP Code:
<?php

opcache_reset
(); 

Place it in the root along with index.php

I think (but have not confirmed) that a couple of php.ini settings will accomplish the same thing.

Code:
opcache.validate_timestamps=1
opcache.revalidate_freq=0

Documentation


RE: Note on using the new opcache - InsiteFX - 06-27-2019

Thanks Dave,

Those seem to work but they would need to be changed for a live server.

Thanks again.


RE: Note on using the new opcache - dave friend - 06-27-2019

(06-27-2019, 07:47 AM)InsiteFX Wrote: Thanks Dave,

Those seem to work but they would need to be changed for a live server.

Thanks again.

Right, those are the development settings only.