These are chat archives for ushahidi/Community

26th
Nov 2015
Raghav Sharma
@RaghavPro
Nov 26 2015 17:47
This message was deleted
hollycorbett
@hollycorbett
Nov 26 2015 18:57
Hey devs! Happy thanksgiving to those US-ians :) … I have a thought experiment (mostly cause I’m messing around with a funky endpoint I’m working on and sifting through all the network traffic to fix it) …. our preflight OPTIONS requests take ages… from where I’m sitting they almost double the load time on many pages (nevermind the multiplication of burden for the backend when you’ve got lots of users up). And I’m not clear exactly what advantage they gain when we’re talking about interacting with our ‘own’ (albeit separate) backend server. As I understand it, the main reason Angular makes them happen for simple (GET) requests is that the mime-type for the requests is application/json, standard browser handling of CORS etc etc blah blah (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests and http://stackoverflow.com/questions/22968406/how-to-skip-the-options-preflight-request-in-angularjs). What if the GET requests were all text/plain and used JSON that we use some library to decode… no need to write a standard format or whatever, but at least be able to avoid the extra burden of the OPTIONS requests.
Of course its entirely possible I’m completely off my tree
and if so, I’d love to learn why :)