Navigation

    APPDRAG Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular

    REMINDER

    Please be respectful of all AppDragers! Keep it really civil so that we can make the AppDrag community of builders as embracing, positive and inspiring as possible.

    Time delay between record creation and being available

    General Discussion
    3
    7
    317
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dick Honing
      Dick Honing last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • Wassim
        Wassim last edited by

        @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?

        1 Reply Last reply Reply Quote 0
        • Dick Honing
          Dick Honing last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • J
            jbenguira last edited by

            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

            1 Reply Last reply Reply Quote 0
            • Dick Honing
              Dick Honing last edited by

              @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?

              1 Reply Last reply Reply Quote 1
              • Wassim
                Wassim last edited by

                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 🕵

                1 Reply Last reply Reply Quote 0
                • Dick Honing
                  Dick Honing last edited by

                  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!

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post