Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Clear OPcache – Our First WordPress Plugin
2 points by jessehorne 50 days ago | hide | past | web | favorite | 3 comments
We (Binary Cocoa) have released our first WordPress plugin and would love to get feedback from the HN community.

It's a simple plugin named Clear OPcache. When installed, it puts a Flush OPcache button in the top admin bar which allows you to flush the OPcache by clicking it. It will let you know if you don't have OPcache enabled and will link you to documentation. It also clears the OPcache/WinCache during a WordPress update.

It's completely free and we'd appreciate any and all feedback. I appreciate your time!

https://wordpress.org/plugins/clear-opcache/

https://binarycocoa.com/




Nice! It sounds like you put some thought into fit and finish.

I'm just unclear under what conditions would one want to flush the OPcache? I've written countless lines of janky PHP experiments and never run into a problem with caching. The only time I can think of flushing it would be on an off-site server where you don't have the ability to reboot or restart PHP. Does PHP wipe the OPcache and start over once it gets full?


Thanks for checking it out! The obvious answer is, you may want to clear it when you have code changes that you'd like to see without restarting the server. You can configure the opcache to never check if files have changed. This makes it even quicker because it doesn't have to check modification times on files. Unfortunately, if you do that, changes to your code aren't ever going to be reflected. This can cause issues in wordpress whenever you update plugins and such. The plugin we wrote automatically will notify php that it needs to clear the opcache so that those changes can be reflected. This way you can have the opcache configured for the highest performance without suffering the drawbacks of not being able to easily update plugins automatically.


Alternatively, you can configure the opcache to check mtime on files, but there is a performance hit for doing that, since each request will be checking the mtime on potentially hundreds of files before accepting that the cache is up to date.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: