what is meaning of Request Sent in google chrome network tab? - api

I am trying to debug why my apis call taking so much time. in google chrome network is showing Request Time is 8 min. what does tell mean like browser took 8 min to send request or it took 8 min to server to response first byte.

Your clients have a slow connection, or someone is abusing their
bandwidth.
The data they are trying to access are very large.
The server has slow upload speed.

Related

Receiving 403 (rate limited) errors from Google Calendar API

We are using the Google Calendar API to keep a sync between our app and events in our users' google calendar.
We have started regularly getting rate limiting errors (403).
However our usage according the APIs and Services page of the google cloud console is well below the stated limits (10,000 queries per minute and 600 per user per minute). We are also using the batch API to send our requests so cannot implement exponential backoff
Anyone got any advice on avoiding these rate limiting errors?
Rate limiting errors with google are basically flood protection you are going to fast. Dont hold to much stock in what the status shows on the Google developer console the numbers in those graphs are guesstimates at best and they are not Realtime.
The main cause for rate limit is that when you send a request there is no way of know which server your request is going to be run on. There is also no way of knowing what other requests are being run on the same server. So your request may run faster or slower than you would expect sometimes which makes it hard to track down exactly what 10,000 queries per minute and 600 per user per minute actually is.
10000 requests run on an overloaded server may run in 2 minutes while on a server that is not being overloaded it could be run in 30 seconds meaning the next request you send will blow out the quota.
As there is really no way of avoiding it you you should just ensure that your application is capable of responding to it by sending the request again. I wrote an article a number of years ago about how i would track my requests locally in my application and then ensured that it kept things at the right speed flood buster
Really as long as your application responds by sending the request again you should be ok.

Google vision API giving sporadic 403 errors

I have a very basic python app that calls the google vision API and asks for OCR on an image.
It was working fine a few days ago using a basic API key. I have since created a modified version that uses a service account as well, which also worked.
All my images are ~500kB
However, today about 80% of all calls return "403 reauthorized" when I try to run OCR on the image. The remainder run as they always have done...
The google quotas limit page lists:
MB per image 4 MB
MB per request 8 MB
Requests per second 10
Requests per feature per day 700,000
Requests per feature per month 20,000,000
Images per second 8
Images per request 16
And I am way below any of these limits (by orders of magnitude) - any idea what might be going on?
It seems strange that simply running the same code, with the same input images, will sometimes give a 403 and sometimes not....perhaps the error is indicative of the API struggling with demand?
Thanks Dave - yes, I have. After much debugging at my end, it seems it was the API that was up the spout :-) All fine now...

New Instagram Rate Limits

We have created an app to display our own feed on our own website. However, we're now exceeding the new rate limit of 500 requests per hour. Instagram says our app does not need review and therefore cannot be upgraded to a "Live" app and take advantage of the higher rate limit. How do we get around this? On a side note, this is a lot of trouble to display our own feed on our own website. Sheesh.
If I got it right, you datafeed is seen by all users, but it's always the same datafeed. So instead of caching it for each user, you could request data each 30 seconds (or less) and store the results in a DB. You should then try always to read feed data from DB but if 15 seconds have passed you should request data from Instagram again.
That would make pretty transaparent to your users

Auto Suggest for very slow internet connections

I have an auto suggestion mechanism that works fairly nice for desktop version where we have a wireless or a wired internet connection. The worst response time is 320ms.
(Without using solr as of now, I use a storage system on the server that gives back the result).
I have users that belong to the group where you can have a slow internet connection also known as a 2G connection where the downspeed can be ~10Kbps-50Kbps.
I have seen that google provides Auto Suggestion to this speed as-well, my my system cannot.
I have tried these:
Make a txt and JSON file on the server and when the user does a keydown (1st) it fires ajax to bring the entire 2.2MB data inside a JS variable on client side and show suggestions.
Make a service that is called when the user types 2 characters, service reads the txt/JSON file for those 3 character occurence anywhere in the words and gives data into a JS variable.
Repeat the above step and store the result in localStorage, for a fresh 3 characters again the same process occurs and storage happens. The benefit is that the user in future gets a prompt suggestion but according to me browser storage is used very sensibly.
Anyone with suggestions how www.google.com and www.flipkart.com handles auto suggestions for slow internet connections on mobile (smartphones).

Uploads restarting indefinitely if they fail - Will it happen on 3G/4G

Is there a way to prevent BackgroundTransfer from trying indefinitely to upload a file. Let's say one of my user is trying to upload a movie from the phone to Facebook. Facebook Graph API doesn't accept byte-range/resume/etc. Let's say the network is slow, less than 50 kbps. Under 50 kbps, BackgroundTransferService will restart the upload.
That being said, when testing my app, I've noticed that the uploaded restarted 4-5 times under my very slow 3G wifi router (yeah... I'm a mix of the two cases).
Will this behavior happen on a GSM/3G/4G network?
What think is that this behavior is totally welcome, on a Wifi, but not on a phone network, as data costs more.
[Edit]
I forgot one important info: I don't have internet on my WP, so that's why I ignore the behavior of BTS on a phone network.
Yes, the agent will try and reattempt the transfer if the connection is dropped. This is one of the benefits of using the agent, you let it worry about reattempting and network conditions so you don't have to. The API does all you a level of control over usage of cellular data via the TransferPreferences property. You could set this if you're concerned. Alternatively, let the user set their own preferences about data usage via the built in settings on the phone.
There is more information at http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202955(v=vs.105).aspx#BKMK_TimelinessofCompletion