0

I host from home, using my home internet connection (Apache on OS X), it's not a business line or anything like that. Still, I manage to get around 20ms ping, 55mbps down and 12mbps up, just so we're clear this isn't some cut-rate DSL connection :P

Anyway, using Pingdom's Website Speed Test, I'm able to test the load times of the various files involved with a website, including HTML, CSS, Js, and .woff files.

The .woff files are for a custom font for the website, and they are hosted both on the server with the rest of the website files and Dropbox.

When I specify in the CSS file to fetch the .woffs from Dropbox, rather than the home server, Pingdom reports a generous performance increase in the website's load time. In fact it goes from about 3s down to just over 1 second to load everything, .woffs included of course.

Of course this isn't surprising because Dropbox does this for a metaphorical living, and therefore we can expect server response time and download speeds to be much better than a home server. Still, what's interesting is that Pingdom reports the .woffs to be a LOT smaller when they come from Dropbox- as much as 95% smaller. All this, when the link to Dropbox is SSL, too.

I tried finding more info on how Dropbox converts or compresses uploaded files, but I'm not finding much. Additionally, when the font is re-downloaded from Dropbox, it is at its original, much larger size.

Does anyone know anything about this? Does Dropbox automatically optimize .woff files for @import-ing? Seems a little magical... Also, it seems like it's taking the home server quite a while to deliver the .woff files, perhaps this is just standard for a home-grade internet connection, but it strikes me as excessively-slow. Each .woff is about 100kB.

I'd love to post a picture, but.... Anyway, here's a link to the screenshot- https://www.dropbox.com/s/qasp9r7s6n8n7ba/Home%20v.%20Dropbox.png (Dropbox is cutting off the bottom for me, so you may opt to download the image and view it locally)

Dan
  • 6,008
  • 7
  • 40
  • 41
james.spinella
  • 241
  • 1
  • 3
  • 11
  • Dropbox definitely doesn't modify your files. Can you give an example of the URL you're hitting on Dropbox to download the `.woff`? Are you sure it's a link to the actual content instead of an HTML page? – user94559 Jul 29 '14 at 19:35
  • I am certain, HTML and CSS come from the home server, and within the CSS file, @import is specified for the font and directs to the public share links on Dropbox. It's simply a matter of Dropbox doing a tremendously-better job at delivering .woff files than my home server. Like I said, though, it seems almost *too* good, and like I said, pingdom reports the font sizes to be 11.4kB rather than their actual sizes (anywhere from ~100kB to ~200kB). I emailed Dropbox, but I don't really expect to find the answer through them, hence the thread here. – james.spinella Jul 29 '14 at 22:02
  • A share link doesn't go to the file itself. It goes to an HTML page that displays the file. I'm worried that's what you're using. Can you give an example of a URL you're using? – user94559 Jul 29 '14 at 22:27
  • Oh right, I get what you're saying now. I guess it isn't loading the fonts at all, then, that explains the file size discrepancy. I'll take my "duh" award and go home, now. The fonts are local, too, so that would explain why they loaded on my end... Well, if only to get something out of this, can you recommend a file hosting site where I *could* host .woff files, I guess the download links would have to be direct... – james.spinella Jul 29 '14 at 23:41
  • You can do it with dropbox. It's hard to tell you exactly how without seeing an example of a URL you're using, but try just putting `?raw=1` on the end of the URL. See https://www.dropbox.com/help/201. – user94559 Jul 30 '14 at 01:08
  • Both ?dl=1 and ?raw=1 work! I ran Pingdom's website speed test multiple times with each and neither seems to offer superior load time, in fact the advantage over hosting the woff files directly on the home server is questionable, as Pingdom reports that using either of the query parameters (ie, ?raw=1) doubles the requests for the woff files. So each woff now takes two requests, one shows as the dropbox link, while the other shows as the .woff file. This equals additional load time for the website, so as I said, DropBox doesn't seem superior to hosting on the home server with the other files. – james.spinella Jul 30 '14 at 15:42

1 Answers1

1

As smarx said, affixing either ?raw=1 or ?dl=1 to the end of a Dropbox link will make the link download directly, no "lobby" page with a download button on Dropbox's website.

This enables one's CSS file to fetch font files and such from Dropbox via @import for example.

In brief testing, it appeared that neither query parameter (?raw=1 or ?dl=1) offered superior performance to the other, and in fact each Dropbox-hosted file takes two requests to load on a website. As a result, it actually appears that it is more efficient (read: faster) to keep the .woff files in my case on the home server rather than Dropbox's "superfast" download servers.

james.spinella
  • 241
  • 1
  • 3
  • 11
  • This is correct. `?raw=1` returns a redirect to the actual content. It's going to be hard for two round trips to beat one. – user94559 Jul 30 '14 at 16:44