logoalt Hacker News

651010/01/20241 replyview on HN

You can make a html website in a torrent. Works surprisingly well.

One time I had a copy of someones website that got deleted and experimented a bit.

The index was paginated linked page titles 50 per page. I combined the paginated pages so that each had 2000 entries (I think it was, maybe 5000) Then I wrote a bit of js that takes a search query from the url?q= looks if it exists on the page, if nothing is found load the next html document and append the query to the url. To my surprise it paged though the pages remarkably fast.

If you want to you could, in stead of display the content, display a search box on each page with the query in it, have a row of dots for the page number (on page 4 display 4 dots)

Displaying 50 or 500 blank pages one after the other goes pretty damn fast if you load them from the file system. They can also be pretty damn big. If you put the content in comments the rendering engine wont touch it at all.

When you update the website you can make a new torrent that has the same folder name and the same files inside. Run a check and the client will discover you had nearly everything already. The only restriction is that it may not change existing html documents.

For that you can just attempt to load non existing scripts in the folder. Have script1.js attempt to load script2.js and 2 look for 3 etc

Can publish updates on a telegram channel.


Replies