jQuery Ajax cache=false doesn't always work
|Reported by:||Owned by:||jaubourg|
When sending an ajax request with the "cache" option set to "false" then sometimes the request is still answered from the browser cache. The reason is that fast machines and fast browsers (like Chrome) are able to send multiple Ajax requests in the same millisecond. jQuery only adds the current timestamp to the URL, looks like this is no longer enough.
This page demonstrates the problem:
Keep reloading the page on a fast machine and you will sometimes get a red "DUPLICATE" warning instead of a green "OK" indicating a timestamp which was already used for a previous request. On my machine this happens on every 3rd reload or so.
I recommend adding another value to the timestamp to prevent this problem. Maybe a static counter? That's how we workaround the problem currently.
Change History (12)
comment:1 Changed 5 years ago by
|Component:||unfiled → ajax|
|Milestone:||None → 1.9|
|Priority:||undecided → low|
|Status:||new → open|