{"action":"created","issue":{"url":"https://api.github.com/repos/inaturalist/inaturalist/issues/834","repository_url":"https://api.github.com/repos/inaturalist/inaturalist","labels_url":"https://api.github.com/repos/inaturalist/inaturalist/issues/834/labels{/name}","comments_url":"https://api.github.com/repos/inaturalist/inaturalist/issues/834/comments","events_url":"https://api.github.com/repos/inaturalist/inaturalist/issues/834/events","html_url":"https://github.com/inaturalist/inaturalist/issues/834","id":128233435,"number":834,"title":"improve image upload performance","user":{"login":"kueda","id":22691,"avatar_url":"https://avatars.githubusercontent.com/u/22691?v=3","gravatar_id":"","url":"https://api.github.com/users/kueda","html_url":"https://github.com/kueda","followers_url":"https://api.github.com/users/kueda/followers","following_url":"https://api.github.com/users/kueda/following{/other_user}","gists_url":"https://api.github.com/users/kueda/gists{/gist_id}","starred_url":"https://api.github.com/users/kueda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kueda/subscriptions","organizations_url":"https://api.github.com/users/kueda/orgs","repos_url":"https://api.github.com/users/kueda/repos","events_url":"https://api.github.com/users/kueda/events{/privacy}","received_events_url":"https://api.github.com/users/kueda/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/inaturalist/inaturalist/labels/improvements","name":"improvements","color":"84b6eb"},{"url":"https://api.github.com/repos/inaturalist/inaturalist/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"pleary","id":48566,"avatar_url":"https://avatars.githubusercontent.com/u/48566?v=3","gravatar_id":"","url":"https://api.github.com/users/pleary","html_url":"https://github.com/pleary","followers_url":"https://api.github.com/users/pleary/followers","following_url":"https://api.github.com/users/pleary/following{/other_user}","gists_url":"https://api.github.com/users/pleary/gists{/gist_id}","starred_url":"https://api.github.com/users/pleary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pleary/subscriptions","organizations_url":"https://api.github.com/users/pleary/orgs","repos_url":"https://api.github.com/users/pleary/repos","events_url":"https://api.github.com/users/pleary/events{/privacy}","received_events_url":"https://api.github.com/users/pleary/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2016-01-22T20:02:55Z","updated_at":"2016-02-04T01:30:05Z","closed_at":null,"body":"Image upload is one of the slowest parts of using the apps, and I think improving performance would make using the apps a lot more pleasant. This seems to be the case even on relatively stable, high speed connections, which would suggest the issue is with server-side performance and not network conditions.\r\n\r\n- [ ] benchmark iNat photo uploads against some other services with API, e.g. Flickr, Twitter, imgur, etc. with a reasonably sized image, e.g. 3MB. Are we really that much slower?\r\n- [ ] audit `ObservationPhotosController#create`: any obvious changes we can make to what's there?\r\n- [ ] enumerate some more sweeping alternate strategies if necessary: what would it take to implement chunked upload? If rails is the issue would it be possible to bypass it, or use an endpoint in the node app? Could we allow clients to upload directly to s3, or with less intervention on our end?"},"comment":{"url":"https://api.github.com/repos/inaturalist/inaturalist/issues/comments/179564586","html_url":"https://github.com/inaturalist/inaturalist/issues/834#issuecomment-179564586","issue_url":"https://api.github.com/repos/inaturalist/inaturalist/issues/834","id":179564586,"user":{"login":"alexshepard","id":515947,"avatar_url":"https://avatars.githubusercontent.com/u/515947?v=3","gravatar_id":"","url":"https://api.github.com/users/alexshepard","html_url":"https://github.com/alexshepard","followers_url":"https://api.github.com/users/alexshepard/followers","following_url":"https://api.github.com/users/alexshepard/following{/other_user}","gists_url":"https://api.github.com/users/alexshepard/gists{/gist_id}","starred_url":"https://api.github.com/users/alexshepard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexshepard/subscriptions","organizations_url":"https://api.github.com/users/alexshepard/orgs","repos_url":"https://api.github.com/users/alexshepard/repos","events_url":"https://api.github.com/users/alexshepard/events{/privacy}","received_events_url":"https://api.github.com/users/alexshepard/received_events","type":"User","site_admin":false},"created_at":"2016-02-04T01:30:05Z","updated_at":"2016-02-04T01:30:05Z","body":"Interesting, I'll take a look to see where those PUTs are being triggered. Certainly not ideal.\r\n\r\nThe API docs discourage using the local_photos attribute, but I don't know why.\r\nhttps://www.inaturalist.org/pages/api+reference#post-observations\r\n> local_photos[]\r\n> List of fields containing uploaded photo data. Request must have a Content-Type of \"multipart.\" We recommend that you use the POST /observation_photos endpoint instead.\r\n> Allowed values: Photo data"}}