[PHP] Fixing API to use CloudFront using AWS S3

I am currently uploading photos to AWS s3 bucket and that S3 URL is being saved in the database as shown picture below:

[url removed, login to view]

Now I just created a Cloudfront Distribution since I believe its will boost the speed of retreving images.

However, not since a Cloudfront URL is automatically generated for any object that is uploaded to my bucket, the S3 URL needs to be replaced with the Cloudfront URL when serving the images, And how to do that?

I want to do either option 1:

Like i think it can be done either by creating another column in db for the generated Cloudfront URL and pulling that, still i dont know how to do it?

or option 2: Replace the s3 URL in the obtained URL with cloudfront URL when are pulling it from database.

So what best think to do to make it work?, I need help to switch to CloudFront but still my data stored in S3 bucket OR substitute for the CloudFront URL using a string replacement function (easy, but hard-coded).

Or Whatever easier for you..

Gist of S3 uploading code:

[url removed, login to view]

Kemahiran: Perkhidmatan Web Amazon, PHP, Kejuruteraan Perisian

Lihat lagi: the s3 service does not have version:, cloudfront php files, missing required client configuration options laravel, cloudfront sdk java, php cloudfront invalidation, php cloudfront client, aws sdk php cloudfront, cloudfront php example, amazon aws s3 api, whatsapp api send message using php, zend api import contacts using php, twitter tweets using php streaming api, contact using php icontact api, using aws query api net, spinner chief api use php

Tentang Majikan:
( 79 ulasan ) Kuwait, Kuwait

ID Projek: #14864480

3 pekerja bebas membida secara purata $43 untuk pekerjaan ini

$44 USD dalam sehari
(5 Ulasan)

Hi, Thanks for giving me this opportunity to give you proposal for your requirement. I have reviewed your requirement and i find this quite interesting, i would like to work on this project. Relevant Skills and Experi Lagi

$55 USD dalam sehari
(139 Ulasan)

Have already done it on many websites Can fix it for you.. We are using cloudfront URL instead of S3 URL. you can also use signed URL for security purposes. At your service Sahil

$30 USD dalam sehari
(0 Ulasan)