Is there any caching to Moodle API responses?
We created a new user profile field and set it to mandatory. When any existing user (who already has an account) logs in to Moodle, they get redirected to the edit profile page. This is because the function user_not_fully_set_up kicks in and he is asked to add the new mandatory field value. Once the user fills in the value, he is no longer taken to the edit profile page from the next login. All good here.
Now we have a custom application that relies on Moodle for authentication and uses rest APIs. The function core_user_get_users_by_field gives the exception 'usernotfullysetup' when an existing user logs in. This is good. We added error handling for this. However, when the user does add the mandatory filed value in Moodle, we still get the usernotfullysetup exception for the user.
We tried using curl cache control header but setting it to no-cache did not do the trick.