Pramod Sivadas
Pramod Sivadas

Reputation: 893

Amazon S3 and PHP

I am building an admin side of an application. It has a page that displays the all images from an amazon s3 folder. Page displays 10 images at a time. So the case is that I have to send 10 request to amazonS3 server to fetch 10 images. Any one knows some other way to get these 10 images by a single request or some thing better?

I am using codeigniter and an amazons3 class (http://undesigned.org.za/2007/10/22/amazon-s3-php-class)

Upvotes: 0

Views: 319

Answers (3)

Lord Loh.
Lord Loh.

Reputation: 2477

Check out this post. People conclude that using S3 for multiple small objects is going to be very expensive.

May I suggest that depending on your application, you may have one (or a few) zipped (or tared) file that you can fetch at a time, decompress (untar) it on your server and display it in your web app. This is a good choice if the files change less and are fetched a lot of times.

An alternative crazier idea - You could use sprites ;-)

Upvotes: 0

Danack
Danack

Reputation: 25701

You ought to be caching all images from S3 on your local server to reduce S3 requests and bandwidth usage.

Unless every page has unique images this should drastically reduce the number of S3 requests you make - though obviously when the image cache is empty there will still be the same number of requests passed through to S3.

Upvotes: 1

Ibrahim Azhar Armar
Ibrahim Azhar Armar

Reputation: 25745

For every image there will be one http request regardless of any programming language. So unless you use something like image sprites as far as I know there is no other way

Upvotes: 2

Related Questions