Question
How to use CDN to prevent visitors from reaching your server?
Does anyone have any experience with CDN? I have been struggling with traffic spikes lately, which would overload Apache/MySQL and kill the server.
To dip my toes into CDN I have been using CloudFlare’s free service, but this hasn’t prevented traffic spikes from killing my server.
I have been reading about assigning a separate domain for static content i.e. images … would this help ease server load? Where can I find more information how to set this up?
Appreciate your help. For reference, the website I am referring to is ASTIG.PH.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
A CDN is ideal to mitigate traffic spikes and also to improve performance. I use DigitalOcean in combination with KeyCDN
A CDN will definitely take away traffic from your origin server (droplet). As you mention it’s common practice to create a subdomain for your static assets (e.g. images.yourdomain.com). This subdomain will then point to the CDN and that’s how you offload traffic away from your droplet.