REMINDER
Time delay between record creation and being available
-
What is the acceptable time delay for a record to be available via a get functions after this record has been created in an AppDrag database?
-
@Dick-Honing said in Time delay between record creation and being available:
What is the acceptable time delay for a record to be available via a get functions after this record has been created in an AppDrag database?
Hi,
There is no delay. As soon as it's written in the database, it can be fetch.
Did you have a case in which you thought there was a delay? -
@Wassim yes, I have a case where there's an occasionally delay. Mostly it's instant, but unfortunately not always. I even built a separate routine for temporarily storing the data as I can't seem to rely on this.
-
Maybe your request to get the data from db is a GET method, in that case there is a 30 sec cache on all GET.
If you want to avoid that configure your api function in POST instead, there is zero cache on POST
-
@jbenguira thanks for letting me know. And uh ... can perhaps point me in the right direction on how to change my web page logic, as ../.products?id=123 is no longer going to work ... right?
-
If you link to products?id=newproductid you can't have cache for this id, so this should work fine.
If you encouter cache issues maybe you can provide us links to pages / functions so we can investigate -
As Joseph mentioned, a get function gets cached for 30 seconds. Based on tip from Wassim; I now add a random number which force refreshes the get.
I made the following function, which probably can be simplified quite a lot
function refresh() { let params = (new URL(document.location)).searchParams; let id = params.get("id"); let d = new Date(); let urlrefresh = window.location.href.split('?')[0] + "?id=" + id + "&uc=" + d.getSeconds() + d.getMilliseconds(); location.replace(urlrefresh); }
The idea behind this, is that I add a random &uc[number] behind the url.
Thanks Wassim!