Skip to content
Advertisement

Include File Get New Content Last Changed

I’ve created a file called “settings.php”

and inside settings.php

JavaScript

And in index.php I updated the content of settings.php using file_put_contents

JavaScript

After successfully updated the content, in index.php I call the settings.php

JavaScript

But after I print_r, the result is

JavaScript

and after sometimes waiting (maybe 5 up to 15 seconds), I do refresh page again and the content changed to

JavaScript

The problem is, why the updated content not directly changed after I refresh the page? how to get the newly updated content from settings.php after I change its content.

Advertisement

Answer

Check what cache solution is on your server thru phpinfo().

Then you can search solution.

In first you can try this if opcache solution is installed on your server:

JavaScript

or this for normal raw files:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement