You’ll have to change the widget so it uses Javascript to update. An AJAX call would work fine.
Hi donncha, I have one more question about widgets and WP Super Cache 🙂
I’m moving one of mine on Ajax so that it’s compatible with WP Super Cache. I have just one blog with one wordpress instance and can’t keep on installing/uninstalling the cache for testing on that environment.
I just need to know how does your plugin manage wordpress widget activation in the sidebar. Is there any documentation I can read about this topic?
The widget I am moving on ajax just need to know the directory where the plugin is installed so that it can do the xmlHttp call to the right file.
You could call wp_cache_no_postid() if the function exists, that will clear the cache. Does activating a widget set off any action?
Hmmm… so, when I install a new widget, I see it in not cached pages, right? If, when not cached, the php writes:
<script type="text/javascript" src="http://www.yourdomain.com/blog/whatever/wp-content/plugins/my-plugin/myplugin.js"></script>
<script type="text/javascript">
var url = "http://www.yourdomain.com/blog/whatever/wp-content/plugins/my-plugin/myplugin.php?postId=123somethingelse=abc";
doSomething(url);
</script>
then when the post is cached, does WP Super Cache store the complete generated html? If so, I could just warn plugin users that once enabled, my widget won’t appear until the cache has been refreshed.
Thanks