jeudi 5 octobre 2017

Fast Load - Daily Background Image For Website

New to web programming.

I'm using the Unsplash API for my background image for my website like so which should change everyday:

<div class="background" style="background-image: url(&quot;http://ift.tt/2y1kFfD;);"></div>

Now this is slow to load and I don't think I should be calling the API from the client HTML directly.

I wanted to understand how I to implement this and make the background image load fast every time.

Should I be using a CDN for this? If so, do I need to write a job on my nodejs server which'll get the photo every day and store it in the CDN?

Or should I write a job which'll download all possible images, upload to S3 and then write an API wrapper which will handle the daily-changing logic?

Basically, what is the quickest way to load a background image on my client if it's fetched from an external API?




Aucun commentaire:

Enregistrer un commentaire