AKor AKor - 26 days ago 10
jQuery Question

Setting the cache in jQuery $.post() to be false?

I have this code:

$.post("php/tagNotifUnsub.php", $("#tagNotifUnsub").serialize(), function(){
$('#tagSubDiv').load('tags.php #tagSubDiv', function(){$( "button, input:submit, input:button, a#jql, input:radio" ).button();});
});


I understand that $.post is just another name for $.ajax. And I know $.ajax has caching on by default. I want it to be uncached. How can I do that?

Answer

$.post is not cached.

Pages fetched with POST are never cached, so the cache and ifModified options in jQuery.ajaxSetup() have no effect on these requests.

From http://api.jquery.com/jQuery.post/