![]() ![]() At some point, one of those bottlenecks will become critical and however much of the other resources you have won't matter: The website will become very slow, maybe even not responsive at all anymore. Sounds good? It's not, because it will only scale linear up to a point: Any disk can only deliver so much I/O. The resource requirements scale linear with the amount of requests/visitors. Every PHP execution requires CPU, memory and I/O. For a thousand requests/visits: a thousand PHP executions + a couple thousand database queries. So for one request/visit: One PHP execution + a couple database queries. To do that, a PHP script loads the latest blog entries from the database and renders them into an HTML result page. A simple example: Say you have a blog with a start page, listing all recent blog entries. In short: Proxy caches take load of your web server and, since they are delivering only "static" content, are much faster. So, even if the geographic location part is non of your concern, you still should consider using the proxy cache aspect of CDNs to improve the experience of your users. As per their nature, CDNs are also a plain and simple cache a proxy cache (or edge cache) to be precise. However, CDNs are not limited to this use-case. Moving the (static) data to Australia with a CDN improves the client's experience. When a client visits your website the connection will suffer from latency leaving you with a sad client. For example: Your website is hosted in Ireland, your clients mostly sit in Australia. Why use a CDN?ĬDNs are intended as a globally distributed network to provide (not only) website contents faster to geographic locations, which are far from the actual infrastructure, which serves the actual content. There will be follow up articles, building on this one, showing how to work with a CDN as caching layer with specific CMS or frameworks. This text handles the theory of caching - with a couple of practical examples, though. In some instances, I will simplify and be opinionated for the sake of clarity, brevity and reduced complexity. The post does not claim to be exhaustive or even completely precise. To use Content Delivery Networks as HTTP caches you need to know about the proper HTTP response headers: Which are relevant? How do they work? How to you use them? All this I try to answer in this article. This article intends to show you how to get started with this easy to use caching variant. This has changed over the last years, with a multitude of pay-per-use, non-enterprise vendors on the market CDNs became affordable for everybody. Using CDNs has long been something in the domain of the Alexa top 100 something a small(er) website does not need or cannot afford. Mastering HTTP Caching - from request to response and everything ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |