Flow for iOS application that saves images and has a PHP backend: how to increase speed? -
i have ios application, , saves images user profiles. have page user can see other users. have endpoint on php backend allows me fetch image given user id. able to:
1) take picture on phone
2) save picture user in database (using base64 encoded string representation of png of image)
3) re-download image string in base64
4) display image on page user
the problem is, though, these blobs on backend big (about 2.5mb
each), , takes 20-30 seconds per image load or upload. there better way of doing this, increase performance?
quick summary of spoke in comments:
- use gzip transfer (expected 25% increase of speed due base64 encoding)
- store images jpeg, performing
nsdata *data = uiimagejpegrepresentation(image, 0.5);
magic constant 0.5
number found still give image quality still heavy compression
- optionally reduce resolution of image
Comments
Post a Comment