0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 04:48:33 +08:00
discourse/spec/helpers
Alan Guo Xiang Tan a43c0bddf8
PERF: Avoid HTML escaping preloaded JSON (#41978)
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.
2026-07-24 09:25:06 +08:00
..
application_helper_spec.rb PERF: Avoid HTML escaping preloaded JSON (#41978) 2026-07-24 09:25:06 +08:00
email_helper_spec.rb DEV: update base url links to respect subfolder installs (#27740) 2024-07-09 12:42:38 +04:00
embed_helper_spec.rb DEV: Extract embed post date title into i18n-aware helper (#38594) 2026-03-17 09:12:21 -05:00
redis_snapshot_helper.rb DEV: Call Discourse.redis.flushdb after the end of each test (#29117) 2024-10-09 07:19:31 +08:00
topics_helper_spec.rb
user_notifications_helper_spec.rb