Best practices interacting with GTM API

Follow these best practices when interacting with the Global Traffic Management API.

Avoid race conditions

You may run into race conditions when multiple instances are trying to update or activate GTM API properties in parallel.

For example, if you take a GTM property that’s in use (A) and CNAME it to a newly created property (B) in a single GTM update, there is a risk of DoS. If the resolution of A occurs on a Swan DNS server that has the updates, it will send a CNAME to B. However, if the resolution of A goes to a Swan server without the updates, an NXDOMAIN occurs. To avoid this race condition, make each change individually by first creating the new property (B), waiting for it to fully propagate, and then pushing the change to A.