It looks like if I load dynamic content using $.get()
, the result is cached in browser.
Adding some random string in QueryString seems to solve this iss
As @Athasach said, according to the jQuery docs, $.ajaxSetup({cache:false})
will not work for other than GET and HEAD requests.
You are better off sending back a Cache-Control: no-cache
header from your server anyway. It provides a cleaner separation of concerns.
Of course, this would not work for service urls that you do not belong to your project. In that case, you might consider proxying the third party service from server code rather than calling it from client code.