fresco icon indicating copy to clipboard operation
fresco copied to clipboard

2 GET for one file request, is it good ?

Open eldk opened this issue 11 years ago • 8 comments

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

eldk avatar Dec 02 '15 13:12 eldk

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?

plamenko avatar Dec 02 '15 16:12 plamenko

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

eldk avatar Dec 02 '15 17:12 eldk

You can email it to me on plamenko at fb dot com.

plamenko avatar Dec 03 '15 19:12 plamenko

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

eldk avatar Dec 05 '15 09:12 eldk

Can you follow the instructions for debug logcat dumps and paste the results here?

Also are you using OkHttp?

tyronen avatar Jan 05 '16 13:01 tyronen

@eldk : Ping on @tyronen's questions.

Also here are some ideas on how to make progress:

  1. Try your urls with a very simple sample app (use one from the /samples directory). Do you still see the double gets?
  2. 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?

balazsbalazs avatar Mar 14 '16 21:03 balazsbalazs

Hello,

I try to reproduce it now.

are you using OkHttp?

This was done without OkHttp.

Thanks,

Eric

eldk avatar Mar 15 '16 08:03 eldk

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

eldk avatar Mar 15 '16 09:03 eldk