I wanted to know if there is a easy way to set up cloudfront. Im pretty new to laravel and looking for a guide on how i can achieve this. If anyone has sample projects or tutorials on how i can do this, please let me take a look into it.
I have heard that its pretty easy to implement into laravel but i have no experience in this subject so i dont really know how to get started.
@ctaljaardt AFAIK, a CloudFront distribution uses your S3 buckets/containers to serve your content. For your bucket management you will need the S3 Flysystem driver on your Laravel end. The CloudFront distribution for a container needs to be configured from your CloudFront Console.
You do not necessarily need to connect Cloudfront to an S3 bucket, but you could set it up to use a so called "origin server" instead.
Basically this will map you cloudfront distribution xxx.cloudfront.net to your website www.mydomain.com
Then all you need to do is rewrite the file URLs and links in the markup from e.g. www.mydomain.com/images/image.jpg to xxx.cloudfront.net/images/images.jpg.
Cloudfront will then search for the file at www.mydomain.com/images/image.jpg and distribute it.
Then all you need to do is rewrite the file URLs and links in the markup from e.g. www.mydomain.com/images/image.jpg to xxx.cloudfront.net/images/images.jpg.
You can also set up your dns so cdn.mydomain.com points to xxx.cloudfront.net.
Then you set your server as the origin server and you just have to change your url from www.mydomain.com to cdn.mydomain.com.
@AMJADKHAN896 - you would need some sort of CI/CD to run to do that compile, then put it where ever you pointed your distribution; be it your server a bucket whatever