Open rhagenson opened 3 years ago
Thanks for opening this request and nice suggestion !
@rhagenson Please check out https://github.com/manuzhang/mkdocs-htmlproofer-plugin/pull/11
@manuzhang Should this issue be closed since #11 has been merged?
I leave it open because the cache size is hardcoded currently
We need caching between runs and maybe even a git tracked cache file as the current implementation does showdown the execution by more than an order of magnitude. LRU cache does not help here.
We need caching between runs and maybe even a git tracked cache file
@ssbarnea Can you share your usage and elaborate on your idea?
If the plugin is enabled locally, each time mkdocs serve
reloads, the URLs are revalidated. So it is slowing down that use case. Although it might not be a main use case (I am assuming that most users enable it in CI only).
@mschoettle Yeah, the way I use it is a special "check urls" task that is separate from mkdocs serve
each time mkdocs serve reloads, the URLs are revalidated.
maybe we can add an option not to revalidate URLs on reload
It was determined during a PR here, that in its current state mkdocs-htmlproofer will re-validate URLs it has seen before.
In order to maintain an upper bound on memory consumption, perhaps a new option should be added such as
cache-size: 500
which will maintain a FIFO queue of the most recent500
validated URLs. Each possible URL would then be checked for membership in the queue and, if present, the previous validation result repeated. My original idea a month ago was to only cache valid URLs, but I think caching invalid maybe is slightly improved -- although there is possible rationale in trying to re-validate on a set of possible error codes such as 429s, as we saw in the aforementioned PR.@manuzhang Since you requested I open this issue, is there any additional information or question you have for me? (I apologize that I took a month to open this issue following your request.)