You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We were seeing issues with page cache (Disk: Enhanced) method not being cleared via the WP CLI with:
wp w3-total-cache flush all
After some debugging, I discovered this was because the page cache files were created by the web server user apache, and we were running the command as a different user which didn't have permission to delete the files.
However, the plugin does not report this - it comes back with the following message:
Success: Everything flushed successfully.
This is incorrect, because the code to clear the cache uses @ to silence errors when calling unlink.
I believe the plugin should either remove the @ operator, or check whether the current user has permission to delete the cache files and display a warning/error if not.
The text was updated successfully, but these errors were encountered:
All silencers are there by intent.
unlinks may try to remove already removed file by other thread 1ms ago.
Removing will cause more harm for runtime operation than profit.
Also any deeper checks in that critical place will affect performance.
No simple solution here, while complain makes sense of course.
Thanks for the response. I understand the concerns.
How about checking the file owner / permissions of just the first file to be removed and if it differs from the current user displaying a warning instead of / as well as the success message?
We were seeing issues with page cache (Disk: Enhanced) method not being cleared via the WP CLI with:
After some debugging, I discovered this was because the page cache files were created by the web server user
apache
, and we were running the command as a different user which didn't have permission to delete the files.However, the plugin does not report this - it comes back with the following message:
This is incorrect, because the code to clear the cache uses
@
to silence errors when callingunlink
.I believe the plugin should either remove the
@
operator, or check whether the current user has permission to delete the cache files and display a warning/error if not.The text was updated successfully, but these errors were encountered: