2

I am using ImageMagick in Codeigniter 2.x to save multiple copies of an image for a social site. After each crop, it sends the image to an AWS s3 bucket.

I am wondering if there is any way to make this process Asynchronous in PHP to keep the user from having to wait for 4 crops and saves before returning the response.

brettywhite
  • 521
  • 4
  • 14

1 Answers1

0

You can introduce a queuing system in your codeigniter project. If you are on AWS, one option is to send a message to SQS to indicate an image has been uploaded, and you can process the images asynchronously without holding up the user, https://aws.amazon.com/articles/PHP/1602

You can also use AWS Lambda taking a serverless approach, http://docs.aws.amazon.com/lambda/latest/dg/walkthrough-s3-events-adminuser-create-test-function-create-function.html

or Cloudinary (http://cloudinary.com/) offers a great cloud solution that will provide a very flexible image resizing/processing service for most projects for free.

Won Jun Bae
  • 5,140
  • 6
  • 43
  • 49