I have a simple cache mechanism:
$settings = @include('/var/www/cache/settings.php');
if ($settings === false)
{
$settings = get it from DB
file_put_contents('/var/www/cache/settings.php', '<?php return '.var_export($settings, true).';', LOCK_EX);
}
it works fine, but as seeing the error logs (I do log the surpressed errors too) it happens often: about 30 times a day. I have more visitors, it doesnt happens often - but it only should happen ONCE! When this file doesnt exists. Still, it happens frequently. What can it be? Its not a facebook-like page to have millions of visitors. Mightbe BOT-s are reading the site too often and multiple calling can cause concurrency?
Edit: no, its not duplicated, you can all see I applied absolute path.