Open willnorris opened 8 months ago
Good shout. I hadn't seen the fastLatest=true
so I'll do some timing checks, but maybe I can use that (disabled) in the "backup" call.
I'll definitely fix this in the coming week (just slightly more offline during xmas period)
I was trying to figure out why the haveamint.com link in this post of mine wasn't redirecting to the wayback url.
It appears to be due to how unrot is calling the CDX API. My blog post has a publish date of 2023-12-15, so that's being included in the CDX call. But the last snapshot that wayback has for that URL is 2023-06-07. Because unrot is specfying the date as the
from
parameter, this is understandably returning 0 results:You could possibly change that to use the
to
parameter, accepting slightly older snapshots. However, that seems to have some odd results when usinglimit=-1
, returning a much older snapshot from 2017:I suspect this has to do with the
fastLatest=true
parameter being implied, and whatever caching that is doing to try and determine the latest result. Specifying even two latest results seems to get the actual latest:Reading the CDX docs, that does seem to be a more expensive query for the wayback API, particularly for URLs with lots of snapshots.
This is also somewhat of a contrived example where I'm intentionally writing a post with a known dead link, so that may not be worth optimizing for. For my case, I could always just manually make it an unrot link, or maybe specify a snapshot date to use in the link itself:
<a href="https://haveamint.com" data-snapshot-date="2023-06-07">
or something. But I thought I'd bring it up and see what you think.