mirror of
https://github.com/discourse/discourse.git
synced 2026-08-05 11:52:32 +08:00
Large preloaded JSON was stored inside an HTML attribute. Because JSON contains quotation marks that could end the attribute early, Rails had to convert those characters into HTML-safe text. Processing every character made the response larger and slower to generate. This change places the preloaded JSON in a non-executable `application/json` script element and reads it from the element's text content. On a site with 11K categories, the escaping was showing up as a hotspot where we spend ~400ms escaping the massive preloaded JSON. |
||
|---|---|---|
| .. | ||
| about | ||
| admin/backups | ||
| application | ||
| badges | ||
| categories | ||
| common | ||
| default | ||
| dev_mode | ||
| embed | ||
| exceptions | ||
| finish_installation | ||
| groups | ||
| home_page | ||
| invites | ||
| layouts | ||
| list | ||
| metadata | ||
| offline | ||
| posts | ||
| published_pages | ||
| qunit | ||
| robots_txt | ||
| safe_mode | ||
| search | ||
| session | ||
| sitemap | ||
| static | ||
| tags | ||
| topics | ||
| user_notifications | ||
| users | ||