質問

this is most probably not really android related, but in my game users can download content via akamai cdn. this works nicely except for jpeg files which for some users are delivered with a different compression. this is somehow depending on the device / android build version / provider / location (and therefore actual akamai node).

since i do a hash check after download to check if the file was delivered properly i get a different hash for a manipulated jpeg file and detect an error.

i already changed the download process so that all files are named

filename_ext.bin

so that the mime type would be application/octet-stream instead of mage/jpeg, but still it seams that some node in the middle ( a proxy maybe? ) checks for the file content and recompresses the jpeg (to save 10-20% of jpeg size; after all, cpu power is cheap, bandwith is expensive).

does anyone have any experience with this kind of problem?

maybe a solution would be to zip every file and unzip on the device ( hoping that whatever is altering the file does not unzip / change jpeg / zip again).

thanks in advance.

役に立ちましたか?

解決

ok, just got answer from akamai support:

"some providers have transparent proxies installed that dynamically re-compress image graphics (jpg and gif) - they also modify HTML pages. Images are recognized based on their file signature and not based on file extension."

so I actually have to encrypt / zip the files to circumvent that...

also: http header

Cache-Control no-transform

also did the trick.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top