Developer resources

Rate limits and being a good API citizen

Code you write once runs everywhere you sold it. A request pattern that is harmless from your machine is something else entirely multiplied by every buyer, all firing at the same moment.

Never call on every page load

Licence checks, update checks, anything external: cache the answer and re-check on a schedule. A busy buyer site can serve hundreds of pages a minute, and none of them need to ask us anything.

Spread your scheduled work

If every install checks for updates at midnight, everybody's midnight arrives at once. Offset by something stable and specific to the install, such as a hash of the licence key, so the load spreads across the hour by itself.

Back off when told to

A 429 means slow down, and the response usually says for how long. Retrying immediately turns a temporary limit into a sustained one. Wait, then retry, and lengthen the wait each time it happens again.

Set a timeout, always

An outbound call with no timeout can hang a buyer's page until their server gives up. A few seconds is plenty for a licence check, and failing to the cached answer is better than making somebody wait.

Identify yourself

Send a user agent naming your item and its version. When something does go wrong at scale it is the difference between us being able to tell you and having to guess.

Related: handling the offline grace period properly.

Turn your code into income.

Join the authors selling templates, scripts and plugins to developers worldwide. Keep up to 85% of every sale.

Start selling →