From 01f86bbaf551455be9f040ef971fc4bc1e0f78b8 Mon Sep 17 00:00:00 2001 From: Alex Dzeda Date: Wed, 3 Apr 2024 09:04:51 -0500 Subject: [PATCH] add best practices section and 429 recommendations --- _includes/build/best_practices.html | 7 ++++++ _includes/build/best_practices_429.html | 15 ++++++++++++ build.html | 31 +++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 _includes/build/best_practices.html create mode 100644 _includes/build/best_practices_429.html diff --git a/_includes/build/best_practices.html b/_includes/build/best_practices.html new file mode 100644 index 0000000..2611682 --- /dev/null +++ b/_includes/build/best_practices.html @@ -0,0 +1,7 @@ +
+

+ There are many ways to accomplish the same objective within BCDA, and following our list of best practices can ensure optimal performance for all consumers of BCDA. +

+ +
+ \ No newline at end of file diff --git a/_includes/build/best_practices_429.html b/_includes/build/best_practices_429.html new file mode 100644 index 0000000..04abf62 --- /dev/null +++ b/_includes/build/best_practices_429.html @@ -0,0 +1,15 @@ + +
+

Occasionally, when interacting with BCDA, you might encounter responses with a status code of 429 Too Many Requests. This can happen for two main reasons:

+ +

BCDA assigns 429 response codes based on two independent criteria:

+ +
    +
  1. Making too many HTTP requests in a period of time.
  2. +
  3. Attempting to create duplicate jobs.
  4. +
+ +

Regardless of the reason, BCDA will include a Retry-After header in its response. It's considered best practice to wait until the period specified in this header has elapsed before making further requests. This ensures your client can adapt without manual intervention, even if the rate-limiting parameters change.

+ +

Concerning duplicate jobs, BCDA defines them as attempts to recreate a job already marked as "In-Progress". For reference, you can view both existing and past jobs by accessing the job history endpoint at /jobs.

+
\ No newline at end of file diff --git a/build.html b/build.html index 04a97f1..0cd2962 100644 --- a/build.html +++ b/build.html @@ -116,6 +116,20 @@ + + +
  • + + Best Practices + + +
  • @@ -266,6 +280,23 @@

    + +
    +

    + Best Practices for Utilizing BCDA +

    +
    + {% include build/best_practices.html %} +
    +
    +

    + Handling 429 status codes +

    +
    + {% include build/best_practices_429.html %} +
    +
    +
    \ No newline at end of file