2 GET for one file request, is it good ?
Hello,
Checking request from Fresco from one HTC device (User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; HTC One mini Build/KOT49H)), I found that for one file request, two GET are pulled (TCPFLOW output):
192.168.001.001.47911-192.168.001.002.00080: GET /folder/file.jpg HTTP/1.1 User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; HTC One mini Build/KOT49H) Host: domain.tld Connection: Keep-Alive Accept-Encoding: gzip
192.168.001.001.36596-192.168.001.002.00080: GET /folder/file.jpg HTTP/1.1 User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; HTC One mini Build/KOT49H) Host: domain.tld Connection: Keep-Alive Accept-Encoding: gzip
192.168.001.002.00080-192.168.001.001.36596: HTTP/1.1 200 OK Date: Wed, 02 Dec 2015 13:39:29 GMT Server: Apache/2.2.22 Content-Length: 101945 Etag: W/"PSA-aj-Bw96unpjyP" Expires: Mon, 30 May 2016 12:55:36 GMT Cache-Control: max-age=15549367 Vary: Accept X-Content-Type-Options: nosniff Keep-Alive: timeout=2 Connection: Keep-Alive Content-Type: image/jpeg
......JFIF.............C.
Is it right ?
Greatings,
Eric
Is it possible that there is redirection happening? It's hard to tell when you substituted actual urls with /folder/file.jpg. Also, I only see one response. Why is that?
Hello,
I have no redirection on those urls. I have tested on another device with "Dalvik/1.6.0 " in user agent string and got the same : two GET for one file request. How should I give you some url in private ? Greatings, Eric
You can email it to me on plamenko at fb dot com.
Hello,
I send you urls by mail. With user agent ""Dalvik/1.6.0 " : two gets. Tested on two real device with this user agent. With user agent ""Dalvik/1.4.0 " : one get. Tested on one real device with this user agent.
Greatings,
Eric
Can you follow the instructions for debug logcat dumps and paste the results here?
Also are you using OkHttp?
@eldk : Ping on @tyronen's questions.
Also here are some ideas on how to make progress:
- Try your urls with a very simple sample app (use one from the /samples directory). Do you still see the double gets?
- Try your app with a hardcoded image url to a public, static image which is not in your servers. Do you still see the double gets?
Hello,
I try to reproduce it now.
are you using OkHttp?
This was done without OkHttp.
Thanks,
Eric
Hello,
I'm not able to reproduce it.
ImagePipelineConfig config = ImagePipelineConfig .newBuilder(context) .setDownsampleEnabled(true) // .setMainDiskCacheConfig(diskCacheConfig) // .setWebpSupportEnabled(false) .setRequestListeners(requestListeners) .build();
tcpflow -p -c -i eth0 \(src host 192.168.1.1 and \(dst host 192.168.1.2 and dst port 80\)\) or \(dst host 192.168.1.1 and \(src host 192.168.1.2 and src port 80\)\)
192.168.001.001.35181-192.168.001.002.00080: GET /folder/file.jpg HTTP/1.1 User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.4.2; HTC One mini Build/KOT49H) Host: domain.tld Connection: Keep-Alive Accept-Encoding: gzip
192.168.001.002.00080-192.168.001.001.35181: HTTP/1.1 200 OK Date: Tue, 15 Mar 2016 09:16:16 GMT Server: Apache/2.2.22 Content-Length: 353836 Etag: W/"PSA-aj-4HObs4nmYS" Expires: Fri, 10 Mar 2017 07:48:30 GMT Cache-Control: max-age=31098734 Vary: Accept X-Content-Type-Options: nosniff Keep-Alive: timeout=2 Connection: Keep-Alive Content-Type: image/jpeg
......JFIF..
What have changed :
- https://github.com/pagespeed/mod_pagespeed have been updated (I use it to serve webp on demand - In-Place Resource Optimization - IPRO - https://developers.google.com/speed/pagespeed/module/system#ipro) and doesn't use https://developers.google.com/speed/pagespeed/module/config_filters#preserveurls anymore.
- Fresco have been updated to 0.9.0 since middle January (logs saved from tests on 3 and 4 January still show the double GET for User-Agent: Dalvik/1.6.0)
So it's solved ...
Thanks,
Eric