mkdocs-htmlproofer-plugin icon indicating copy to clipboard operation
mkdocs-htmlproofer-plugin copied to clipboard

Retries & 429 Too Many Requests

Open louwers opened this issue 1 year ago • 1 comments

When checking a lot of URLs of the same origin, it is very easy be rate-limited and get a 429 Too Many Requests response.

It would be neat if some retry logic could be added. The simplest implementation would simply look for a Retry After header. https://stackoverflow.com/a/63684455/1929678

louwers avatar May 23 '24 14:05 louwers

@johnthagen WDYT?

manuzhang avatar May 24 '24 14:05 manuzhang

Hmm, I don't see it as a bad idea but it could add a lot of complexity to the project?

@louwers Does this work as a workaround?

  - htmlproofer:
      raise_error: True
      raise_error_excludes:
        429: ['https://www.mkdocs.org/']

It feels a bit more flexible and if you know you are going to hit a certain URL a lot, you can simply count 429s as "passes"?

johnthagen avatar May 28 '24 12:05 johnthagen

That solution does not work if you need to check a lof of URLS from the same domain.

But we have decided not to run external link validation on CI, but instead only check internal links. If someone else needs this, this can be re-opened.

louwers avatar May 28 '24 21:05 louwers