

Ask HN: What is the purpose of Airbnb's meta content JSON? - cstrasen

A colleague of mine noticed the way they provide key-value pairs (most likely also for their https:&#x2F;&#x2F;github.com&#x2F;airbnb&#x2F;polyglot.js) but oddly doing so via &quot;&lt;meta content=&quot;. There is also application settings in there.
I wonder what the reason might be. JS variables is what I would have expected.<p>some examples:<p><pre><code>  https:&#x2F;&#x2F;gist.github.com&#x2F;christophstrasen&#x2F;9c13e1a94c0aff25844e (settings)
  https:&#x2F;&#x2F;gist.github.com&#x2F;christophstrasen&#x2F;f7ae6424089001aecdc8 (locale)
  https:&#x2F;&#x2F;gist.github.com&#x2F;christophstrasen&#x2F;847d13719bf557a6b823 (translation)
</code></pre>
Ideas:<p><pre><code>  - More comfortable to access via the DOM?
  - SEO (but why config settings?)
  - Caching</code></pre>
======
gpmcadam
The alternative would be to generate JSON as a JavaScript file or in a SCRIPT
tag, so my guess would be so that it can be rendered as part of the view
without generating code.

Another reason would be that they keep the same HEAD but swap out the BODY for
things like a/b testing, caching, page loading, etc.

Either way, after you determine that you don't want to store JSON as part of
your BODY, the HEAD is the only other place you can store it, and if you don't
want to generate code, then META tags probably make the most semantic sense.

~~~
cstrasen
Here is what I got back from wonderlib (their services seem a bit hammered
right now) [https://wonderlib.com/research-
network/response/557a3aa79718...](https://wonderlib.com/research-
network/response/557a3aa79718d46d00b772e3)

