PHP filesize on Linux is statcached and require to use clearstatcache in order to clear the cached filesize

Title PHP clearstatcache - Manual
Description Note: This function caches information about specific filenames, so you only need to call clearstatcache() if you are performing multiple operations on the same filename and require the information about that particular file to not be cached.
Tags clearstatcache,php,filesize