Hit counter invalidates Options cache for every request
-
Hello, I am reporting a performance-related issue that would affect high-traffic websites, especially those utilizing object caching while using the Worker plugin.
In worker/src/MWP/EventListener/PublicRequest/SetHitCounter.php the
countHit
method often increments a hit counter stored in thewp_options
table. The resulting call toupdate_option()
triggers an UPDATE query and also invalidates the entire options cache, triggering a DB query.The volume of UPDATE queries (which lock the table) and subsequent SELECT queries can drastically impact website performance.
Please provide 1 or more of the following solutions to mitigate the performance impact:
- An option to disable the hit counter
- An alternate storage mechanism for the hit counter value
Thank you for your consideration.
- The topic ‘Hit counter invalidates Options cache for every request’ is closed to new replies.