4 ms·
Pages are saved in the background. Nothing too fancy. I dedup when uploading: that helps a lot.
by purplerails 12y ago
Pages are saved in the background. Nothing too fancy. I dedup when uploading: that helps a lot.
- idlewords 12y agoOkay, but how do you handle things like big PDFs or image gallery sites? Or pages that just pull in a lot of javascript includes? That stuff downloads in parallel, but then I would find myself trying to push it upstream through a little straw of bandwidth, sequentially.
- purplerails 12y agoYou're right, it takes longer to upload a page than to download it. And image gallery-like pages take long (I know because I save Imgur pages now than then :)). But in practice, this isn't a problem. There are a couple of heuristics to avoid wastefully uploading pages: the full page is uploaded only if the reader expresses "sufficient interest" in the page. Currently the heuristic is 90 seconds of continuous reading of a page, or scrolling to the bottom. If a page is read for a minimum of 10 continuous seconds then only the text of the page is uploaded. Static assets like JS files benefit from deduping: they take time to upload the first time, but subsequently processing them is much faster. Typically, people read multiple pages in a browsing session: I rapidly open many tabs and then read each one for multiple seconds. There's a debug mode in Purple Rails in which a timer counts up when I switch to a tab. I find that typically spend 100+ (usually much more) seconds on a page that I read through to the end. This is usually enough time on a residential broadband connection (I have Sonic DSL) to finish uploading a page. I also use Purple Rails on a tethered 4G connection almost everyday: uploading is slower than DSL but it works. Basically, by the time you finish reading a tab, the previous tab you read would have finished saving. Like I said, nothing too fancy.
- idlewords 12y agoSweet, thanks for the detailed answer! I look forward to checking it out.
- skrebbel 12y agoHow can you dedupe if the content is encrypted?
- purplerails 12y agoDeduping is per-user not across users. For the sort of content here, this works well. E.g., static assets of web pages are the ones that are dedup-ed. The basic algo is to generate a HMAC of the plaintext and compare it against a table of previously uploaded blobs' HMACs. HMAC is keyed with a key derived from the user's password. When a blob is uploaded, the ciphertext and HMAC of the plain text are both uploaded.