r/DataHoarder • • 7d ago

Discussion Why do modern JavaScript websites become so difficult to archive properly?

3 Upvotes

6 comments sorted by

2

u/CONSOLE_LOAD_LETTER 6d ago

WACZ via archiveweb.page browser plugin recording then replay via standalone offline local replayweb.page has been the most reliable and accurate way to archive and preserve javascript-heavy pages in my experience. It's still not perfect on all sites though.

Both tools are open source so you can have a look at what they are doing under the hood, and even fork them if you wanted to. Or maybe contribute to those projects yourself to help build upon them: https://github.com/webrecorder

2

u/Exact_Wrongdoer9018 5d ago

The gap you are hitting is not "HTML plus assets". It is that wget and HTTrack model a site as a URL graph, and a React/Next site is not one. Three failure modes I keep running into:

  1. The URL saved is the route, but the content came from a fetch to something like /api/feed?page=2 that a static mirror has no reason to know exists. Even when you save that JSON, the replay often requests it with a different query string, or with a signature that no longer computes, so you get the hydrated skeleton with empty boxes.
  2. Client-side routing never issues a document request. Next.js pushes a history state, so the mirror sees one page and zero links and dead-ends at the landing view. The only fix I have found is walking the UI (clicking the items) and capturing along the way instead of enumerating URLs.
  3. Timing. Grab too early and you archive the spinner. Grab on plain network idle and infinite scroll keeps it busy forever, so I cap depth per page and accept losing the tail.

To your second question: WARC/WACZ, not a browsable mirror. In a replay that serves archived responses back to the page through a service worker, the original JS still runs and its own fetch calls get answered, so client-side routing survives. A mirror rewritten by wget --convert-links breaks exactly there.

Frequently changing pages: I snapshot on diff, not on a timer. Hash the canonical HTML plus the API responses, and only write a new capture when the hash moves. Each capture gets a sha256 sidecar, and I verify the previous one still parses before pruning it, because a truncated gzip record in a WARC fails silently and you only find out during a restore.

Honest limit: canvas or WebGL dashboards never replay right for me. For those I keep a screenshot pair next to the WARC and label it as a fallback rather than pretend the capture is complete.

2

u/Itsthejoker ~50TB Usable 6d ago

Blame AI companies. They scraped so hard that they ruined it for everyone.

0

u/[deleted] 6d ago

[removed] — view removed comment

2

u/Itsthejoker ~50TB Usable 5d ago

I really think it's the primary reason. I run a fairly popular 3d printing website where I publish original data, and every time I get hit with a crawler swarm it's noticeable. Since the advanced ones run JavaScript, they show up as a real visitor on the metrics who stayed for zero seconds; imagine trying to explain to a potential sponsor that "oh yeah my normal bounce rate (people who only view one page and then leave) is 49%. I know it's 13% in the dashboard, but you gotta trust me, bro"

I spend more time trying to keep my site from going down because some asshole decided to hit me with thousands of IPs from around the world than I do actually updating the site. As someone who's been doing this since 2019, it's fucking depressing.

I have an API with the same information that's a lot less work for me to render. They just don't fuckin use it.

1

u/issue9mm 22h ago

If you switched to something like NextJS instead of jQuery, you could cache each page as they were rendered and be far more resilient to swarms