1

I am using Jquery Datatables to populate some data from the server. Below is the code I am using.

          var table = $(function  ()  {
           var table=$('#dataTable').dataTable( {
              "jQueryUI": true,
              "dom": 'T<"clear">lfrtip',
              "sPaginationType": "full_numbers",
              "sAjaxSource": HOST_NAME+"/states/",
              "sAjaxDataProp": "content",
              "bFilter": true,
              "oSearch": {"bRegex":true, "bSmart": false},
           });
           var tt = new $.fn.dataTable.TableTools( table );
         });

But during the ajax call I see an extra parameter http://myserver.com/states?_=1410160127424. I do not want to send the __=1410160127424 parameter since I am using varnish to cache the data. How to override the default implementation to restrict the extra parameter in the url.

Thanks

1 Answer 1

2

jQuery dataTables are using jQuery AJAX. So simply change the default settings for AJAX sessions :

$.ajaxSetup({ 
   cache: false 
});
Sign up to request clarification or add additional context in comments.

1 Comment

@Pradeep, just realized - what version of dataTables are you using? To answer your question, this should be runned before any dataTable() but if you use 1.9.x or below, another approach is nessecary (in 1.9.x cache is hardcoded inside the datatables script)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.