Google Plus Profile Subscribe to RSS feed LinkedIn Profile Follow me on Pinterest Watch our Youtube Videos Find us on Flickr Stumbleupon Profile
CoolHandle

Using GD Star Rating with cache plugins

Thumbnail for Using GD Star Rating with cache plugins

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.

cache support 300x61 Using GD Star Rating with cache plugins

Activate cache

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.

GD Star Rating
loading...

Share this:

del.icio.us DiGG Google StumbleUpon Google Buzz Microsoft Live MiXX RSS PDF
Using GD Star Rating with cache plugins, 7.4 out of 10 based on 284 ratings

2 Responses to “Using GD Star Rating with cache plugins”

  1. Scott | November 3, 2009 at 1:12 PM

    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

    GD Star Rating
    loading...
    GD Star Rating
    loading...
    • MillaN | November 3, 2009 at 1:23 PM

      Yes, for WP Super Cache you need to add “ajax\.php”. I am not sure about other plugins, but it should be something similar.

      GD Star Rating
      loading...
      GD Star Rating
      loading...

Comments are closed.

Blog Rating

Average blog rating:

7.5

www.dev4Press.com

Dev4Press is a premium service dedicated to developing of high quality plugins and themes for WordPress, custom development and consulting. Follow this link to find out more...

Feedburner Feedburner updates

Sign up to receive all latest news about GD Star Rating directly to your email.