37
$\begingroup$

Just today or yesterday, Math SE's MathJax libraries are no longer loaded from mathjax.org but from cdnjs.cloudflare.com. mathjax.org explains that they are shutting down at the end of this month. But I was wondering, why is StackExchange not just getting a local copy instead of relying on a CloudFlare distribution? After all, it's little compared to the amount of data in StackExchange itself. Am I missing something?

$\endgroup$
  • 2
    $\begingroup$ I will just point out that there are several other sites in SE network using MathJax. So this is probably more a network-wide issue rather than an issue related only to this site. (Of course, there's nothing wrong with discussing it here first.) $\endgroup$ – Martin Sleziak Apr 11 '17 at 4:52
  • 2
    $\begingroup$ For all I know Stack Exchange's very own CDN is also hosted by Cloudflare. In that sense they already rely on Cloudflare for various other things. $\endgroup$ – quid Apr 11 '17 at 8:43
  • 4
    $\begingroup$ You might want to consider rephrasing this. "Should bla bla do beepity bop?" is a question that nobody outside bla bla has any answer. Might as well ask "Should all the universities in the world decide to give Asaf Karagila permanent tenure everywhere?", the answer is of course "Yes. Yes they should.", but since this is not in our hand, this remains very theoretical. So... you might want to think about a different way to phrase this. :) $\endgroup$ – Asaf Karagila Apr 11 '17 at 15:36
  • 1
    $\begingroup$ @AsafKaragila: Isn't Meta the best place to ask? Partly so that other people who have the same question can see the answer? By the way, your question about tenure sounds like it might fit on Workplace SE.. =P $\endgroup$ – user21820 Apr 12 '17 at 5:12
  • 1
    $\begingroup$ I wasn't complaining about where you made the post. Rather on the way you chose to phrase it. $\endgroup$ – Asaf Karagila Apr 12 '17 at 6:44
  • 1
    $\begingroup$ @AsafKaragila: Which phrasing is problematic? I was asking a factual question, because there must be some reason. And indeed Glorfindel gave what is likely the most important reason. $\endgroup$ – user21820 Apr 12 '17 at 14:44
  • 5
    $\begingroup$ As a user of NoScript, I have to point out that enabling MathJax now seems to require whitelisting cdnjs.cloudflare.com which is way too broad for my taste. $\endgroup$ – ccorn Apr 13 '17 at 12:37
  • 4
    $\begingroup$ @ccorn: If you can use UBlock Origin (not the other UBlock), you can whitelist only "cdnjs.cloudflare.com/ajax/libs/mathjax". Now you know how I knew about this change. $\endgroup$ – user21820 Apr 13 '17 at 15:25
  • $\begingroup$ @user21820: Thanks. For NoScript, I find that one can whitelist https://cdnjs.cloudflare.com and add an ABE rule Site https://cdnjs.cloudflare.com/ajax/libs/mathjax/* Anonymize Site cdnjs.cloudflare.com Deny (with line breaks before uppercase letters). $\endgroup$ – ccorn Apr 13 '17 at 16:38
  • 2
    $\begingroup$ @ccorn: By the way, you may be interested in whether NoScript is bad, which till today nobody has given a proper answer. I can't vouch for UBO being clean, but at least it doesn't ring the same alarm bells in my head... $\endgroup$ – user21820 Apr 13 '17 at 16:43
  • $\begingroup$ @user21820: I know what you mean (and I have changed some of its self-whitelisting options). Saying more would be off-topic here. $\endgroup$ – ccorn Apr 13 '17 at 16:50
22
$\begingroup$

After all, it's little compared to the amount of data in StackExchange itself.

Yes, you're right; Stack Exchange wouldn't notice if they need to serve an additional library like this. However, one of the main advantages of using a central distribution, like CloudFlare, instead of hosting it yourself, is that users are likely to visit multiple sites using the same library. If you visited another website which is using CloudFlare to host MathJax, it doesn't need to be downloaded again when you visit this site. This improves page loads and user experience, so the ultimate benefit is for the user and not for Stack Exchange itself.

$\endgroup$
  • 3
    $\begingroup$ In addition to that would they serve it "themselves" presumably it would be put on CDN sstatic.net which is also provided by Cloudflare. $\endgroup$ – quid Apr 11 '17 at 9:07
  • 1
    $\begingroup$ I see. Thanks for the explanation. $\endgroup$ – user21820 Apr 11 '17 at 10:29
4
$\begingroup$

Well, if SE goes down, even temporarily, it wouldn't matter where the math rendering is loaded from. But if the math rendering goes down for whatever reason, you still have access to the text version and the interactivity that SE provides, along with readable LaTeX, without the pretty math rendering. So there is an advantage in that.

Also, it reduces the work load of SE servers. This makes SE a more stable and reliable site for the raw content. Different servers then can be optimized for certain uses.

Separate servers devoted to math rendering that can be used on any site helps to standardize the aesthetic, code, etc.

$\endgroup$
  • $\begingroup$ But why not host it yourself so if cloudflare goes down you still have the pretty math? $\endgroup$ – Feathercrown Apr 14 '17 at 12:15
  • $\begingroup$ That involves installation of software for every user that comes to this site, and others, and hopefully the same software. Not everyone is savvy in such things. $\endgroup$ – CogitoErgoCogitoSum Apr 14 '17 at 19:14
  • $\begingroup$ Personally I prefer the LaTeX-to-jpeg image conversions. They only need to be compiled once into an image and stored somewhere. Re-compiled only at the first rendering of any edit of the LaTeX code. Having it done on the fly on every computer requires recompilation of the LaTeX into imagery on every computer, every time, and that is wasted computation power. $\endgroup$ – CogitoErgoCogitoSum Apr 14 '17 at 19:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .