Repository navigation
Faster first page: start new workspaces from the demo by linking its large files - #279
Merged
Merged
Conversation
A new online session copied the whole example workspace (about 300 MB) before the page drew anything, which made the first page, the consent banner and the captcha take 10 s or more. The demo's large files are now linked and only small files copied (the template's seed_new_workspace), and FileManager replaces a link before it stores a result, so the shared demo is never written to. The consent bundle is built in production mode (183 KB instead of 1 MB). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGem9AQZyiiA18C2cHQH
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Tom · project thread
Needs OpenMS/streamlit-template#571 (same
common.pyand consent bundle changes; the template sync will bring them in without conflict once both are merged).Why
A new visitor on flashapp.webapps.openms.de waits 12–14 s before the consent banner and captcha appear. The captcha itself takes under 1 s; about 7 s is the server copying the 297 MB example workspace into the new session's workspace before the first page is sent (live waterfall: scripts loaded at 2.2 s, no server frames until 9.2 s).
What changes
settings.json:demo_workspaces.new_workspace: "default", so a new workspace starts from the demo through the template'sseed_new_workspace(), replacing FLASHApp's own copy inpage_setup().src/common/common.py: the template'sseed_new_workspace()/copy_demo_workspace(): files of 1 MiB or more are linked, smaller ones copied. For the demo: 48 files (286 MB) linked, 132 (11 MB) copied.src/workflow/FileManager.py:store_dataandstore_fileremove a link before writing, so storing a result again writes a file of the workspace's own and never into the shared demo.Timings
Screenshots
Video of the live first load today: live-before-first-load.mp4
Explore results on a workspace started this way (linked example data, the demo unchanged afterwards):
Tests
tests/test_file_manager_links.py:store_dataandstore_filereplace a linked file and leave the demo unchanged.python -m pytest tests/: 1123 passed, 2 skipped.pylint --errors-onlyon the changed files: clean.Generated by Claude Code