Table of contents
Persistent object cache and page cache
Object cache (Redis, Memcached)
A persistent object cache keeps copies of the site's options between requests. When an option is written by a process that does not use the same cache, the web requests can keep reading an old copy. WP-CLI is often such a process: some cache plugins turn their object cache off on the command line.
What the plugin does:
- The keys (Anthropic, vector server) are always read from and written to the database itself, never through the object cache: a key saved is never reported missing.
- At activation, and after a
wp lrob-chatbotcommand that changes settings, the plugin drops its own options from the object cache.
What to do after changing settings from the command line, if the site still behaves as before: empty the object cache with your cache plugin, for example
wp cache flush
# W3 Total Cache:
wp w3-total-cache flush object
Page cache
Pages kept by a page cache carry the chat window as it was when they were cached. The plugin empties the known page caches by itself when what the window shows changes: the first Anthropic key, Shown to, the button, the look, the name and welcome message. Supported: W3 Total Cache, WP Rocket, WP Super Cache, LiteSpeed Cache, SiteGround Optimizer, Breeze, WP Fastest Cache. Each purge is written in the log.
For another cache, hook the action fired at the same moment:
add_action( 'lrob_chatbot_front_changed', function ( string $why ) {
// Empty your page cache here.
} );
A cache in front of the site (a CDN, Varnish) is not reached from WordPress: empty it yourself after such a change.