Why is AJAX posting the same query twice?
Why is AJAX posting the same query twice?
dmclean
Posts: 55Questions: 2Answers: 0
Description of problem: I was watching the network activity in my browser and I see that DataTable is posting the same query twice (different "draw" and "_" parameters but otherwise identical).
What could be causing the duplicate queries? Since the queries are DB queries which could take significant time, I would like to eliminate the second query if possible.
Answers
Good question. That doesn't happen by default. Sounds like you have server side processing enabled and a piece of code calling
draw()
causing the second request. Can you post your relevant Datatables code so we can see what you have? Better is a link to a test case showing the double ajax request problem.https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin