Grails: best way to send cache headers with every ajax call

后端 未结 2 767
北荒
北荒 2020-12-16 00:21

It\'s well known that Internet Explorer aggressively caches ajax calls whereas all the other browsers grab the data fresh every time. This is usually bad: I\'ve never enco

2条回答
  •  悲哀的现实
    2020-12-16 00:47

    We use jQuery for all ajax calls so we add this block to our main.gsp (top-level layout):

    
      jQuery(document).ready(function() {
        $.ajaxSetup({
          cache:false
        });
      });
    
    

    Also answered here

提交回复
热议问题