I have a WordPress site that gets some data from external API and uses different endpoints to post data. Each endpoint is defined separately and all requests are made over wp Ajax to those endpoints. All POST requests have noonce key assigned to them; in theory, it should be handled fine. All the GET requests are cached with WP caching option for 5 minutes.
Now the problem part begins. When I have 2 browser windows open (one incognito) and send the data the last one should fail, since there is a time option that must be unique, but the request goes through. In some cases, it even happens when one request I have already done and a few moments later the same time slot is still available and when selected the request goes through.
When testing the API endpoint in different environments with Insomnium (like Postman), everything seems to work as intended from the API side as in when the request comes in with a duplicate time field API returns an error for the duplicate entry.
In WordPress side all the requests have error handling built, so if the API returns an error it displays it to the user. WordPress instance has no other caching plugin installed. There is external caching from Cloudflare but there are exceptions made not to cache the API .
Does anyone have any ideas or recommendations to help to debug/figure out why is it acting the way it is.
[ad_2]