1

We want to implement caching to speed up the website performance.

What would be beneficial in this case - using CDN or Cache control HTTP headers?

2 Answers 2

2

They provide different speed boosts. I doubt headers would speed things up measurably for you. Unless you have significant performance issues on the server side.

CDN could speed up things for visitors from other countries that may have significant routing delays reaching your server.

To properly speed up a website, you need to first analyze page loading bottlenecks and address them rather than just do random improvements hoping for results.

1

Depending on where your servers are located relative to your audience, and the type of audience, these do different (but overlapping) things.

Using cache control headers on your web server will mean that visitors looking at content on your site they have seen recently will load fast. If your clients are all close to you (ie close as in the paths between your server and theirs), a CDN will not give a significant speed boost if your server has the bandwidth and speed to handle the requests (and bandwidth is likely more relevant as cached content is often quite lightweight in terms of CPU)

Using a CDN will in many cases distribute the content closer to your client, so it is read once per region, and then fed to the clients - thus if more then 1 client in a caching region accesses the CDN, it will be faster for the second client then to serve from your servers directly. You will likely find that CDN's will use Cache Control as well. Likewise, using a CDN can provide a level of robustness if your site is overloaded or temporarily unavailable. (Also, CDNs can reduce your swrvers bandwidth requirements)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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