Object cache and AJAX issue
-
Hi,
I have a specific issue tested on a site I was working on (and disabling the object cache the issue disappears). By steps:– entering a plugin admin page, it loads a set of options using get_option(…) which returns an array (the set of options – an associative array – is serialized by WP)
– a form with those options is shows
– the user changes some of those options and saves: the update_option(…) with the new array is called
– the admin page reloads and starts a series of ajax calls (to the standard wp-admin/admin-ajax) to compute some results using the new set of options and display them
– the ajax handler, a regular one coded using the WP standard and registered with “wp_ajax_[action]” uses the get_option(…) to retrieve the set of new optionsNote: “wp_ajax_*” is used and not the “wp_ajax_no_priv_*”.
The ajax handler does not get back the new saved options but the previous one. Dumping them shows actually the old values. Hence the update_option(…) seems to not trigger a cache invalidation.
Is there something I can do to have the current set of options when retrieved in an ajax context and not the cached one?
Thak you, Stefano.
The topic ‘Object cache and AJAX issue’ is closed to new replies.