3

I need to use all the pre-hosted images on AWS as a product images in magento. Is there a way to refer those image urls in magento without exactly uploading in magento ? Thanks !

asked Jan 15, 2017 at 16:42
0

1 Answer 1

1

I'm not overly familiar with 2.1, but in 1.x the answer is no, because Magento uses the media directory when it creates thumbnails for cache files.

You can sync these to and from an S3 bucket and use it for serving your assets (better; cloudfront over S3) to the frontend and admin areas easily enough, but you can't avoid having them stored on your server as well since files are created by the server as well.

There are some modules around which try to let you mount an S3 bucket to your file system, but since it is not designed to be a filesystem (S3) it doesn't tend to work very well.

If I were you:

  • use an NFS share mounted media directory (if you have multiple web nodes)
  • sync to and from S3 on a cron job- how often is up to you. Sync operations can use a fair amount of CPU, so do it in low traffic times.
  • add a CloudFront distribution to point to your S3 bucket (distributed CDN), then;
  • point your media directory (in configuration) at the CloudFront URL
answered Jan 15, 2017 at 18:54
3
  • 1
    All, good points, Robbie. The same holds form Magento 2, the different image sizes are generated by Magento on the local filesystem which needs to be shared between the nodes. Commented Jan 15, 2017 at 23:13
  • Magneto code can be easily changed to get images from a different URL. Commented Jan 16, 2017 at 11:53
  • @ButtleButkus yes, see my sentence about changing the setting Commented Jan 16, 2017 at 17:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.