when i request something via ajax if the input is the search the content seems to be cached? do i add a random number at the end of my query?
/search?input=test
to
/search?input=test&random=283928392
i think this would solve my problem. right? how do i write this in javascript
At the beginning of your script (before any AJAX) put:
$.ajaxSetup({
cache: false
});
That will solve your problem because it will automatically add the random number for every jQuery request. If you don't use jQuery for your AJAX this won't work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With