#Laravel


How to cache S3 stored pictures to local disk and serving them from your web server

How to cache S3 stored pictures to local disk and serving them from your web server

The problem

Recently I worked on upgrading a legacy Laravel v4.2 to a newer version of Laravel. The site stored user uploaded pictures, which where stored locally on the app's public folder.

Now, I didn't like the fact that those pictures where stored locally because if the server went down the picture files would go down as well. Therefore deploying to a new server would require the hassle of manually restoring the pictures from a backup.

I was thinking to upload all images to S3 and serve them from there, but on the other hand I didn't want to get additionally charged from AWS S3 for the pictures bandwidth. 

How could I get a local cache of those pictures? Here is the solution that worked for my case.

Testing a live site with Laravel Dusk using Docker Compose

Today we will do a quick tutorial on how to quickly install and run Laravel Dusk on your project using Docker.

We will use Docker only for running the selenium driver. It isn't therefore needed to use rocker to run the site we're testing again.