
GD Star Rating supports dynamic loading of ratings using AJAX calls from early 1.6.x versions, and from 1.7.0 this support is completed. With this you can use plugin on websites running some cache system or cache plugins like WP Super Cache.
By default, if you use cache plugins, the whole page will be saved to cache, and that will include rating blocks. Because of that ratings will not be up to date and even can be locked preventing voting even if the user/visitor can vote. Since many users use some form of caching on their blogs, GD Star Rating needed a support for caching. And now, you can activate and use this feature.
Here is how this works. Once you install (or upgrade) to latest plugin version you will need to activate cache support. Option for this is on the Settings panel, on the first, Features tab. You simply need to check this option, and save settings. After this, you also need to delete all cached files so that cache plugins can recreate them using new rating blocks that will be active now. You also need to add plugin (or only ajax.php) file into list of exceptions for your cache plugins, so that AJAX response is not cached along with everything else.
Instead of rating blocks, plugin will render placeholder blocks with loading message. Once the page is fully loaded, plugins javascript code will collect id’s of all ratings blocks and send one or two requests to server to get the real rating blocks for articles and comments.
So, that’s it, pretty simple. You can test it with cache plugin you are using, and if you find any problems report it here or in the issue tracker.
loading...






November 3, 2009
at 1:12 PM
Direct link
Hi,
Thanks for the post.
Just wondering if you could give an example for:
“You also need to add plugin (or only ajax.php) file into list of exceptions for your cache plugins, so that AJAX response is not cached along with everything else.”
What exactly do we add to the exception list for WP_Cache or WP_Super_Cache? “ajax\.php”?
Thanks
loading...
November 3, 2009
at 1:23 PM
Direct link
Yes, for WP Super Cache you need to add “ajax\.php”. I am not sure about other plugins, but it should be something similar.
loading...