2

My dreamhost plan offers me to use cloudflare CDN to speed up my pages. My page uses PHP/MySQL. I was wondering how this works, because everytime the page is loaded it must execute the PHP code and the MySQL query anyways on the dreamhost servers, so cloudlfare can't speed it up, right?

4

You need to understand what a CDN is. CDN means Content Delivery Network, rephrazed; a network to deliver your content.

Indeed, CloudFlare can't speed up your PHP scripts or MySQL queries. CloudFlare will host your static resources (images, videos, JS and CSS files, etc.) on many servers over the world to permit to all your visitors to download them faster (in relation to their location) when visiting your website.

|improve this answer|||||
  • 4
    It's worth mentioning that Cloudflare has a feature called "page rules" that allow you to serve cached versions of HTML generated by your web app on a per-page basis. If you want to serve entire static pages containing little dynamic content from Cloudflare instead of from your own server, you can do that. This is useful for About pages, FAQs, and even for busy dynamic sites that update periodically. Cloudflare is more than a CDN, so it's not limited to serving static images and scripts – you can have it cache and serve whole pages too. – Nick Apr 25 '14 at 11:32
  • 1
    OK Nick, thanks for this information, I didn't know. – Zistoloen Apr 25 '14 at 12:31
1

Just to help clarify...

CloudFlare caches these static content files by default

If you want to extend our caching beyond static content, as mentioned, you can use PageRules to accomplish this.

Really not going to help speed up mysql queries.

|improve this answer|||||
0

A CDN will cache your websites resources that are declared cacheable (or based on some rules) near your users, on data centers spread over the world. As someone real smart said before I was born, "Latency is king". It means that any millisecond "nearer" to your users (data travels no faster than light) will drop response time sharply. I've tested Amazon.com CDN CloudFront, on a real ecommerce website, time dropped 300ms for home page, which may convert to 3% more sales, only by bringing every one of the 85 product pictures 4ms faster.

You can even go further speeding up a website by setting up some content optimizing platform in front of it. The path would then become: User -> CDN -> Content optimizer -> Your web server

These platforms will strip profiles and comments from images, minimize CSS and JavaScript, Gzip what is not yet, conform image sizes to a hand tailored template, and the likes.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.