header ad

Saturday, August 11, 2018

Prevent browser caching of AJAX call result

$.ajax({
    method: "GET",
    url: "/Home/AddProduct?",
    data: { param1: value1, param2: value2},
    cache: false,
    'Cache-Control': 'no-cache, no-store, must-revalidate',
    'Pragma': 'no-cache',
    'Expires': '0'
     success: function (result) {
        // TODO
    } 
});


No comments:

Post a Comment