These are chat archives for ushahidi/Community

29th
Nov 2015
Ushbot
@ushbot
Nov 29 2015 21:47
[Robbie Mackay, Ushahidi] ... late to this conversation. I was under the impression that pre-flight OPTIONS requests were done by the browser to check CORS headers, not angular at all
[Robbie Mackay, Ushahidi] ie. you can't turn it off
[Robbie Mackay, Ushahidi] perhaps we could vastly speed up the options requests though..
hollycorbett
@hollycorbett
Nov 29 2015 21:50
on my random learnings it seemed like for GET requests they werent necessary to meet browser standards, and it was only happening cause angular made it happen and that only happened because of the mime type not being ‘safer’ than application/json. But not sure. Either way :)
Ushbot
@ushbot
Nov 29 2015 22:01
[Robbie Mackay, Ushahidi] interesting.
I'd rather not mess with content type headers just to avoid the preflight: We're sending JSON so we really should be sending application/json headers.. but if its a significant speed up it might be worth it. That said, our OPTIONS requests really shouldn't take long
[Robbie Mackay, Ushahidi] but we're a little heavy handed with handling them I guess
hollycorbett
@hollycorbett
Nov 29 2015 22:01
yeah that makes sense… they take essentially the same time as the actual GET requests.. which is odd
Ushbot
@ushbot
Nov 29 2015 22:38
[Robbie Mackay, Ushahidi] we push them through a full usecase, and authorizer flow to get the meta info and figure out which methods are allowed.. so its similar to a GET request, just without the DB hit.
[Robbie Mackay, Ushahidi] how long are the requests taking for you? if you're local dev box is taking seconds (not ms) for API requests, it might be an issue with the virtualbox filesystem
[Robbie Mackay, Ushahidi] Which is easily fixed by switching to NFS instead
hollycorbett
@hollycorbett
Nov 29 2015 23:06
same - on virtualbox too