Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching with post requests #564

Closed
frett27 opened this issue Dec 17, 2013 · 1 comment
Closed

Caching with post requests #564

frett27 opened this issue Dec 17, 2013 · 1 comment

Comments

@frett27
Copy link

frett27 commented Dec 17, 2013

using a remote transport with post method, doesn't send the request. because the requestcache make a hit on the cache.

elastic search doesn't support extra parameters for caching timestamp.
i had to disable the cachingrequest check for insuring the request to be sent.

it could be smart to take the post method into consideration.

modified code snippet that work for me :

get: function(query, cb) {
var that = this, encodedQuery = encodeURIComponent(query || ""), url, resp;
cb = cb || utils.noop;
url = this.replace ? this.replace(this.url, encodedQuery) : this.url.replace(this.wildcard, encodedQuery);
/* if (resp = requestCache.get(url)) {
utils.defer(function() {
cb(that.filter ? that.filter(resp) : resp);
});
} else { */
this._get(url, cb);
// }
return !!resp;
}

@jharding
Copy link
Contributor

Duplicate of #562.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants