开发者

How to load cross-domain image faster using file_get_contents and base64_encode?

I need to load images faster to my web app from facebook or flickr. I use php file_get_contents and base64_encode function to get photo cross-domain and pass the image data to html5 canvas. All other processings are done client-side and I am happy with that.

You can try it here : http://onlinephotomashup.com

The problem is delay in loading photo to my app.

I have researched on cURL and file_get_contents to see which is faster and i concluded that they do very little in loading photo faster. So I move to base64_encode which encode the photo i开发者_如何学Cnto text whose size is increased to more than 30% of the size of the photo. So I think my problem is here.

I want to base64_encoding the photo with less size than the size of original photo so that loading is faster. How to achieve that ?


May be, gzip output of base64_encode? And send appropriate header to clients browser so it would ungzip the data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜