Cache causing problems with setting/reading options in a plugin
-
We have run into an issue with a plugin that was thinking it had to update its database even though it was already done, and it caused corruption. The plugin author fears this may affect other portions of the site.
They say:
Indeed, it was a caching issue that prevented WP options from being read correctly after an update call. Disabled the Litespeed cache plugin, and — issue gone. As a developer, you always expect that when you calladd_option
you’ll be able to use that value in the course of the same request.They were using get_optoin to get a value, then delete_option and add_option to make changes, and when the LiteSpeed cache was active it seems this was not working properly, their plugin was getting a stale value instead of the just-updated value.
Is this something that can be fixed by some exclusions in the cache? It isn’t a particular page, it is the plugin code that is seeing this problem.
- The topic ‘Cache causing problems with setting/reading options in a plugin’ is closed to new replies.