AWS S3 Sync

From Apoyar Wiki
Revision as of 10:00, 8 November 2021 by Admin (talk | contribs) (Created page with "AWS S3 SYNC ---------------- • In the AWS Management console.To serve the images and videos to ZEB Website we use content delivery Network(CDN).It means CDN is an server w...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

AWS S3 SYNC



• In the AWS Management console.To serve the images and videos to ZEB Website we use content delivery Network(CDN).It means CDN is an server which is running somewhere in the world.it actually cache all the content.We are now connecting zeb website from india.For this we need to setup cloudfront distributions


• For the pictures and the videos we have Zeb media Distribution and Zeb static for JS And CSS files all the contents and the scripts.


• The zeb Media is serving from the zeb-upgrade-image-s3.S3 is an file storing system with the Amazon.We had an bucket named zeb-upgrade-image in this we will have all the jpg’s.


• The cloudfront distribution is getting all of them from S3 the reason is these are the files with beyond 400KB.


• We automatically Sync all jpg files over to the S3 bucket and whenever the customer checks any one in the browser there is an special function changes it to format called webp.The webp is an very efficient image format developed and used by google.


• If the jpg files is 10KB And the webp will be less thean and half of jpg one.


• If sometimes some files wont uploaded to S3 in that case.At that time we can manually do the synchonisation,First we should have to go to the zeb-magento server and then we should go to the /var/www/zebupgrade/pub/media we have to go to the place where all these files are saved.And from there we should run this comand with dry run.With Dry run it wont damage anything aws s3 sync --dryrun . s3://zeb-upgrade-image/ --exclude "*.pdf" --exclude "*.log"


• In the above command we are excluding the pdf’s and log’s so that we can upload only jpg files.


• Now we should run the command without Dry run aws s3 sync . s3://zeb-upgrade-image/ --exclude "*.pdf" --exclude "*.log"


• The Lambda function which is running online for some reason it is not working it uaually converts the jpg to webp.We need to do it Manually after converting we can sync into S3 Bucket.


• First we need to go to path /var/www/zebupgrade/pub/media/ wysiwyg and then cwebp –q 75 RDM_mail_pr.jpg -o RDM_mail_pr.webp (eg – file).