Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

How to cache my recent comments disqus javascript/ajax code? WordPress

I am using this ajax/javascript code to display recent comments on my wordpress site:

var DisqusRecent = {
init: function( config ) {
this.api_key = config.api_key; =;
this.template = config.template;
this.container = config.container;


fetchRecentComments: function() {
url: """&related=thread&limit=10&api_key="+this.api_key,
dataType: "jsonp",
context: this,

success: function(results) {
var source = $(this.template).html();
var template = Handlebars.compile(source);


$(function() {
api_key: 'myapikey',
forum: 'star-style',
template: '#comments-template',
container: '#comments'

how can I cache this for 2 hours at a time (disqus only allows so many requests per hour)

Answers (1)


Reigel Gallarde answers:

This would help you... [[LINK href=""]][[/LINK]]