How to configure caching for ajax request and response

I am working with an ajax request and I received a JSON object as a response from AJAX. Now I am trying to cache this JSON object and how to get data from the cache. I want to show cache data from the following server request with the same request with the same parameter values.

self.categorySelected = function (selectedCategory, event) { $.ajax({ url: '/services/ShopService.asmx/XGetRefurbishedproducts', data: JSON.stringify({ displayName: itemDisplayName, categoryid: selectedCategory.CategoryId(), language: lang }), type: "POST", dataType: "json", cache: true, contentType: "application/json; charset=utf-8", beforeSend: function () { $(event.target).prop('disabled', true); } }).done(function (data) { //sample }) } 
0
jquery c # ajax web-services
Mar 01 '16 at 7:00
source share

No one has answered this question yet.

See similar questions:

65
Caching jQuery ajax response in javascript / browser
3
JSON Cache Response

or similar:

7728
How to redirect to another web page?
7428
How to check if an element is hidden in jQuery?
5129
How to return a response from an asynchronous call?
4345
How to check if checkbox is checked in jQuery?
3952
Setting "checked" for checkbox with jQuery?
3915
Why does Google add while (1); in your JSON answers?
2817
How can I upload files asynchronously?
1744
Cancel Ajax requests with jQuery
1273
How to manage redirect request after jQuery Ajax call
1001
Is Safari iOS 6 caching $ .ajax results?



All Articles