Update routine always runs due to stale object cache
-
Hi,
Our users ran into an issue with the upgrade routine always running on each admin page, causing the page load time to take roughly 50-60 seconds each time.
The issue is Newsletters uses its own object cache to cache its own options: https://plugins.trac.www.ads-software.com/browser/newsletters-lite/trunk/wp-mailinglist-plugin.php#L10178
However, Newsletters never purges any of its own object-cached values when they updated or deleted.
For sites that run an external object cache, this means that all options in Newsletters have the potential of having stale data.
In the specific case of the
updating_plugin()
method, Newsletters checks the saved version against the file version before doing its update routine: https://plugins.trac.www.ads-software.com/browser/newsletters-lite/trunk/wp-mailinglist-plugin.php#L10548.When grabbing the saved version, this value was old and not the same as the value in the DB.
This caused the update routine to always run in the admin area on each page load.
To fix this, we recommend that the
this->update_option()
method should add a call to the$this->set_cache()
method and the$this->delete_option()
method should also add a call to the$this->delete_cache()
method to avoid stale cached items.Let me know if you have any questions.
- The topic ‘Update routine always runs due to stale object cache’ is closed to new replies.