Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pleroma
pleroma
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 394
    • Issues 394
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 55
    • Merge Requests 55
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Pleroma
  • pleromapleroma
  • Merge Requests
  • !2381

Merged
Opened Apr 14, 2020 by Steven Fuchs@stwfContributor
  • Report abuse
Report abuse

Preload data into index.html

  • Overview 36
  • Commits 12
  • Pipelines 15
  • Changes 20

This MR addresses some performance issues by inserting data into script tags into the served index.html file. This will allow FE developers to bypass several data fetches.

The data will be represented by a map, with the keys being the url the data resides at. And the values being the encoded data. The encoding is JSON encoding followed by Base64 encoding. This was the best combination we could find to eliminate leakage from the structure as well as produce valid JSON when decoded.

The tag looks like this.

<script id="initial-results" type="application/json">
{
  "/api/v1/instance":"eyJhdmF0Y...XJfdXBsb2Fk=",
  "/api/v1/timelines/public":"cGZfc3R3Zl8yP...C9zcGFuPjwvYT=",
  "/instance/panel.html":"IjxkaXYgc3R5bG...U9XCJtYXJnaW=",
  "/nodeinfo/2.0":"eyJtZ...XRhZGF=",
  "/status_net/config":"Ijxjb25ma...Wc+XG4="
}
</script>

Closes: #1660 (closed)

Edited Jun 25, 2020 by Haelwenn
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
Reference: pleroma/pleroma!2381
Source branch: preload-data

Revert this merge request

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.