{"action":"created","issue":{"url":"https://api.github.com/repos/buckbaskin/Insight/issues/28","repository_url":"https://api.github.com/repos/buckbaskin/Insight","labels_url":"https://api.github.com/repos/buckbaskin/Insight/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/buckbaskin/Insight/issues/28/comments","events_url":"https://api.github.com/repos/buckbaskin/Insight/issues/28/events","html_url":"https://github.com/buckbaskin/Insight/issues/28","id":159582719,"number":28,"title":"Speed javascript load times","user":{"login":"buckbaskin","id":3441311,"avatar_url":"https://avatars.githubusercontent.com/u/3441311?v=3","gravatar_id":"","url":"https://api.github.com/users/buckbaskin","html_url":"https://github.com/buckbaskin","followers_url":"https://api.github.com/users/buckbaskin/followers","following_url":"https://api.github.com/users/buckbaskin/following{/other_user}","gists_url":"https://api.github.com/users/buckbaskin/gists{/gist_id}","starred_url":"https://api.github.com/users/buckbaskin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buckbaskin/subscriptions","organizations_url":"https://api.github.com/users/buckbaskin/orgs","repos_url":"https://api.github.com/users/buckbaskin/repos","events_url":"https://api.github.com/users/buckbaskin/events{/privacy}","received_events_url":"https://api.github.com/users/buckbaskin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/buckbaskin/Insight/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/buckbaskin/Insight/labels/feature%20request","name":"feature request","color":"0052cc"},{"url":"https://api.github.com/repos/buckbaskin/Insight/labels/js","name":"js","color":"fbca04"},{"url":"https://api.github.com/repos/buckbaskin/Insight/labels/py","name":"py","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"buckbaskin","id":3441311,"avatar_url":"https://avatars.githubusercontent.com/u/3441311?v=3","gravatar_id":"","url":"https://api.github.com/users/buckbaskin","html_url":"https://github.com/buckbaskin","followers_url":"https://api.github.com/users/buckbaskin/followers","following_url":"https://api.github.com/users/buckbaskin/following{/other_user}","gists_url":"https://api.github.com/users/buckbaskin/gists{/gist_id}","starred_url":"https://api.github.com/users/buckbaskin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buckbaskin/subscriptions","organizations_url":"https://api.github.com/users/buckbaskin/orgs","repos_url":"https://api.github.com/users/buckbaskin/repos","events_url":"https://api.github.com/users/buckbaskin/events{/privacy}","received_events_url":"https://api.github.com/users/buckbaskin/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-06-10T08:18:28Z","updated_at":"2016-06-12T07:25:18Z","closed_at":null,"body":"First page is emptyish, with a single html file and css, and a minimal javascript script. That script loads, and sends back the time it finished in utc with a request for the page javascript, which is then loaded into a special div at the end of the body.\r\n# Front end\r\n- Make mini speed loading javascript\r\n- Make simple functional web page to be modified later by javascript. See [progressive enhancement](https://www.sitepoint.com/javascript-dependency-backlash-myth-busting-progressive-enhancement/), think mobile-first? offline-first?\r\n- Instrument the mini javascript to measure the effects of this loading\r\n\r\n# Back end\r\n- Have the mini js and html as static files that can be served quickly\r\n- Instrument the static file response compared to other Flask endpoints\r\n- Based on the mini js and html request, prepare/assemble a bigger js file ahead of the next js request, so that the server has it in memory and requires no disk read when it gets hit by the mini js request. this seems like it could be cool\r\n- Send out that bigger js file to the javascript request at a static-like? endpoint."},"comment":{"url":"https://api.github.com/repos/buckbaskin/Insight/issues/comments/225414678","html_url":"https://github.com/buckbaskin/Insight/issues/28#issuecomment-225414678","issue_url":"https://api.github.com/repos/buckbaskin/Insight/issues/28","id":225414678,"user":{"login":"buckbaskin","id":3441311,"avatar_url":"https://avatars.githubusercontent.com/u/3441311?v=3","gravatar_id":"","url":"https://api.github.com/users/buckbaskin","html_url":"https://github.com/buckbaskin","followers_url":"https://api.github.com/users/buckbaskin/followers","following_url":"https://api.github.com/users/buckbaskin/following{/other_user}","gists_url":"https://api.github.com/users/buckbaskin/gists{/gist_id}","starred_url":"https://api.github.com/users/buckbaskin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buckbaskin/subscriptions","organizations_url":"https://api.github.com/users/buckbaskin/orgs","repos_url":"https://api.github.com/users/buckbaskin/repos","events_url":"https://api.github.com/users/buckbaskin/events{/privacy}","received_events_url":"https://api.github.com/users/buckbaskin/received_events","type":"User","site_admin":false},"created_at":"2016-06-12T07:25:18Z","updated_at":"2016-06-12T07:25:18Z","body":"Current progress as of commit \\<fill this in later\\>\r\n- Serves loadme.js as the mini js file, index.html as a mini (still templated) html file\r\n- The home page counts as progressive assembly, because it isn't trying to do any user visible stuff with javascript anyway\r\n- There is no preassembly done yet, but the first request is cached, so it only ever builds these things once (per cache timeout)\r\n- The files are sent out at a static-looking endpoint ```/j/<filename>.js```\r\n\r\n# TODO\r\n- instrument the mini javascript file to determine how long this loading takes.\r\n\r\n## Maybe?\r\n- instrument the static endpoint to see how it compares to the cached templated endpoint, and see if it makes sense to generate files ahead of time on disk and serve statically. I think I'm fine with how it is right now, it is 8ms or something for the first user, sub ms for the next user :white_check_mark: \r\n- ~~make a home page that is the same for every user until the javascript modifies the page so it can be cached/insta responded without templating. This might cause a regression in speed based on the number of javascript requests, so I think I'll stick with the main home page for now.~~ \r\n  - If I could some how send more data with the built javascript template that would be okay, but it would break the javascript caching instead :(\r\n\r\n## Feature Requests\r\nThese depend on some other issue getting done first, so they shouldn't block this issue.\r\n- implement preassembling of the .js templated files. Maybe do this as a read into cache of the ```n``` most common templates at the start. Or, a separate process (see multiprocessing) that gets run. This might need to wait for #23."}}
{"actor":{"display_login":"buckbaskin"}}