{"id":4700849,"date":"2014-03-12T16:52:10","date_gmt":"2014-03-12T16:52:10","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/possible-plugin-improvement\/"},"modified":"2016-08-21T17:13:16","modified_gmt":"2016-08-21T17:13:16","slug":"possible-plugin-improvement","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/possible-plugin-improvement\/","title":{"rendered":"Possible Plugin Improvement"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I use W3 Total Cache, as my caching plugin. I specifically use the Object Cache, to improve the speed of my WP install.<\/p>\n<p>I was doing some testing, to see if I could speed up my site, and saw that many queries were being repeated over and over against my DB. I investigated and saw that data was being stored in the object cache, but found that the object cache was being flushed periodically, about once every 5 minutes.<\/p>\n<p>I tracked the cause being this plugin. It stores the last run time in the wp options table, using update_option method.<\/p>\n<p>When an option is updated, this causes the Object Cache to be flushed, as the options are also stored in the object cache.<\/p>\n<p>This then causes all of the stored data to be flushed and all of the queries have to be re-executed.<\/p>\n<p>I&#8217;m pretty sure most persistent object cache&#8217;s also flush when the options are ever updated (Super Cache, etc). This increases load on the DB and slows down performance for WP.<\/p>\n<p>Please consider using another mechanism to store the last run time of the plugin. I believe the options data should be pretty much static. It shouldn&#8217;t be updated every 5 minutes.  It should only be updated whenever the admin makes a material change to WP or plugin settings, which does not happen in the normal execution of the site.<\/p>\n<p>I&#8217;m not sure where to store this info though. Because I&#8217;m using a persistent object cache, I can make the change in my own local copy to store the last run time in the object cache (wp_cache_set() ), instead of the update_option(). This would work in my case, but would not work for everyone, as they may not be using a persistent cache.<\/p>\n<p>Thanks,<br \/>\nRich<\/p>\n<p>https:\/\/wordpress.org\/plugins\/wp-missed-schedule\/<\/p>\n","protected":false},"template":"","class_list":["post-4700849","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4700849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4700849\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4700849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}