jQuery Ajax cache=false doesn't always work
|Reported by:||k@…||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 4 years ago by dmethvin
- Component changed from unfiled to ajax
- Milestone changed from None to 1.9
- Priority changed from undecided to low
- Status changed from new to open
comment:3 Changed 4 years ago by jaubourg
- Owner set to jaubourg
- Status changed from open to assigned