How to Clear '10 minutes cache'

Status
Not open for further replies.

devtendenz

Forum User
Joined
Apr 2, 2020
Messages
13
Reaction score
1
I know from the communication in my previous thread (https://www.3cx.com/community/threa...erator-isnt-up-to-this-crm.72123/#post-322121) that the 3CX CRM integration does not call the CRM's API if the same number calls twice within 10 minutes, unless it doesn't have that contacts number in the database or cache.

Now I deleted that number from the database in the webadministration portal, but it still doesnt call the CRM the firest 10 minutes afther the first call. I assume this is the cache then, but how do I clear that?
 
Unfortunately there is no way to clear that cache. You will need to wait 10 minutes or restart the 3CX System Service.
 
Oke so the cache is also for 10 minutes. But, i've adjusted my proxy server app this way that it always returns an empty array ('[]') because we only need the notification in our CRM, so the contact cannot be inserted in the contacts database. I've checked that the contact is indeed not added anymore.

I've also deleted my test contact manually from the db from within the System Management Console. But still, the second time within 10 minutes, the API is not called. Why? It isn't in the contact database, and it can't be in the cache either because it's over 10 minutes (days ago) that I tried this.
 
The cache also remembers that a lookup didn't return any contact, and then for 10 minutes it will not do another lookup for the same number...
 
Okay, now I'm confused. In this post https://www.3cx.com/community/threa...erator-isnt-up-to-this-crm.72123/#post-322121 you said:

" What you can do if you just need this notification, but don't need to add the contact to 3CX Contacts, is just not return the caller's phone number in the JSON response, then the contact will not be added to 3CX Contacts or the cache, and the next call will also be notified. "

But that isnt true then I guess?
 
Just checked the code, and I can confirm that the behaviour is the following:
1) If a contact is returned, it's added to cache for 10 minutes.
2) If the server returns a successful response, but no contact (empty JSON for example), then this "no contact" result is added to cache for 10 minutes.
3) If the server returns an invalid response (for example 404 not found), then nothing is added to cache.

So, if you have control of what the CRM does, you can consider returning an error response (status code different than 200 OK), and that will avoid the cache.
 
Hi Ernesto, thanks, that's what got it working for me, 404 status!
 
  • Like
Reactions: edossantos
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,325
Messages
591,898
Members
165,477
Latest member
Mueller