3

If I pick a hosting package that offers CDN support, then how do server stat tools work, since web pages are served by different servers from all over the world?

Can I rely on them in that case?

  • What do you mean by server stats tools? Do you mean web page analytics or server resource monitoring tools like sysstat? – jeffatrackaid Jul 1 '14 at 17:54
1

Generally with any server-side language in play, your webpages are going to be created by the server directly and won't be duplicated by the CDN.

Instead, a CDN is generally most effective when used on static assets like images, audio or video files, pdfs, word docs, etc. But most of all images, including the images in any page on the server. So you won't get the same stats simply for those static assets, but you'll get most page loads.

In general, I wouldn't worry too much about inaccuracies due to CDN usage, the various stats packages generally have some wiggle room in terms of what they can actually pick up accurately anyway.

And, of course, the benefits of a CDN are worth it if you get a speed boost out of it.

  • I have no experience with CDN, but obviously any request for a web page has to go to the main hosting server first, which then decides to route this request to a particular CDN server. So is this how it exactly works that dynamic web pages can not be stored on CDN, Or hosting account allows to change some settings to change this behavior? – head_scratcher Jul 1 '14 at 5:32
  • It certainly depends on which CDN you use, you'll have to read the specific docs there, but in some cases the request will be routed -through- the CDN before hitting your server at all and there will be a list of file types that the CDN will then cache (.png, .jpg, .gif, .jpg, .jpeg, .mp3, .js, .css, .swf for example), and maybe it'll additionally cache page content (.html, .php) based on your caching headers, giving you control. Generally, a CDN of that nature has to allow you some control of whether a html page caches because they have no way of knowing if the content updates dynamically. – Kzqai Jul 1 '14 at 19:13
  • Aha! that's what I was thinking, a CDN server does not need to know what mechanism (database/file) web server is using to produces a page. I did some more search on this and found that CDN is not a straight forward thing to use. One has to be aware of the possible awkward outcomes. Or I could use Amazon AWS which has everything at one place, but then its a whole new learning curve, and currently not my need I guess. – head_scratcher Jul 1 '14 at 23:34
  • Yeah, there are issues that you have to deal with, (e.g. "I just fixed some css in my css file or js in my js file, now how do I cachebust to ensure that people get the new stuff?"), but by definition, the overall benefits are almost always worth learning the issues for, because your problem is now "people already have the assets, how do I update them?" instead of "people are getting my key assets too slowly, how can I give them faster?". – Kzqai Jul 1 '14 at 23:42
  • Good point. In order to improve user experience, my job is to solve upcoming issue, whichever it is. – head_scratcher Jul 2 '14 at 9:09

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.