0

I'm working with ajax request and I received JSON object as a response from AJAX. Now I'm trying to cache that JSON object and how to get data from cache.I want to show the cache data from next request to the server with same request with 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
    })               
}
Devi Prasad
  • 829
  • 1
  • 11
  • 33
  • 1
    `cache:true` works `Get` not for `post`.Check for this lin http://stackoverflow.com/questions/17104265/caching-a-jquery-ajax-response-in-javascript-browser – shu Mar 01 '16 at 07:05
  • this may be relevant : [Cache JSON response](http://stackoverflow.com/questions/17379312/cache-json-response) – Danish Mar 01 '16 at 07:06

0 Answers0