How CDNs and TYPO3 offer Superior Speed, Uptime, and User Experience

|Benni Mack
TYPO3 is Optimized for Super-Speedy CDNs

Today’s world is global, and content distribution networks (CDNs) bring content closer to users around the world for lightning-fast performance wherever they are. TYPO3 is ideally adapted to modern CDN technology, reducing the load on your server, and even taking caching off your to-do list!

What are CDNs?

CDNs are essentially globally distributed caches—data storage and delivery points closer to your site visitors. While your server may be in the USA, if a significant number of your users are in Australia then it makes sense for your content to be ready and waiting somewhere in the South Pacific region. This is achieved through the use of “edge servers,” which serve static content such as images, JavaScript files, and HTML to your users. Of course, if another user is in Buenos Aires, you should offer an edge server in South America, too. There’s no limit to how many edge servers you can have. 

Benefits of distributed caches:

  • Reduced load on the origin server, which only needs to be referred to for dynamically generated content.
  • Massively improved performance, because the distance between your user and your content is reduced and the content is routed through fewer bottlenecks. This makes for a better user experience and higher conversion rate.
  • Caching is taken care of for you if you use a commercial CDN provider. Say goodbye to Varnish configuration and maintenance headaches.
  • CDN providers can protect against DDoS attacks.

One of the main challenges with using CDNs is ensuring that content isn’t out of date, while also avoiding routing requests to the origin server unnecessarily. Broadly, there are two approaches to this: pull and push. “Pulling,” the CDN can request any resource it doesn’t already have from the origin server, then store it for future reference and serve the cached resource in response to identical requests in the future. Or you can anticipate requests by actively “Pushing” your content to the server before that specific resource has been requested. 

Broadly speaking, pulling is suited to situations where content changes regularly, pushing, where content is largely static.

A related challenge is “cache invalidation,” defining (or scheduling) when content in the distributed caches could be out-of-date and signalling for a refresh or update. This ensures resources available on the CDN server are in sync with the origin server.

If you choose a commercial, software-as-a-service CDN, then all of this should be taken care of—depending on the level of configurability your provider offers.

Broadly speaking, pulling is suited to situations where content changes regularly, pushing, where content is largely static.

Delivering dynamic content with CDNs and TYPO3

TYPO3 is ideal for integration with CDNs and setting up a CDN in TYPO3 is straightforward. The TypoScript option config.sendCacheHeaders = 1 needs to be activated, and from there on, you only need to configure your DNS settings to point to the CDN’s entrypoint and you’re good to go.

If you use our b13 proxycachemanager bridge extension, the CDN can cache most of a page’s resources and specifically request any dynamic page content. In other words, it caches the static resources and static pages, and just asks the server to fill in the blanks, which could be further extended using Edge-Side-Includes or Server-Side-Includes. This wouldn’t be possible without TYPO3’s strict approach to semantic, structured content and use of cache tags, whereby individual blocks can notify the system that they have been updated. For more detail on how this works, see my articles on caching.

Whatever (currently supported) TYPO3 version you’re using, you can set them up with a CDN—all bug fixes have been backported from v10 to v9 and v8.

Speaking  of which … If top-notch performance is what you’re after, you really should upgrade to a current and supported TYPO3 version, preferably v10.

In short, anything that can be cached can be delivered via a CDN. Currently, CDNs are working hard to build solutions that calculate some dynamic content and deliver it straight from the cache without needing to contact the origin server.

When do I need a CDN and how should I choose one?

Enterprises, especially those with global scope, really need CDNs to keep page load times snappy. If you’re growing, it’s something you should consider, too. Remember, either way you’re going to need an HTTP cache like Varnish even if you don’t go for a CDN—so it’s worth thinking about saving yourself the work. And, as mentioned above, protection against DDoS attacks is increasingly part of the bargain and worth it for many enterprises.

Overall, above a certain size of website, your users will react to speedy page-load times by staying on your website for longer and coming back more often.

If you decide against a CDN because you feel you’re not big enough yet, TYPO3 has got you covered if you change your mind later. You can activate caching and plug into many CDNs later, without much hassle.

When choosing a CDN, there are a few factors to bear in mind:

  • Compare uptime stats: you don’t want to buy the aforementioned benefits at the cost of shaky availability.
  • Don’t forget about response time, or latency: even if the request completes fast once it’s initiated, you need to be sure the time between the request and response is fast, too.
  • Configurability is important if you want to tailor your CDN to your needs, which we certainly like to do at b13.
  • Price isn’t the only important factor, but needless to say you don’t want to be paying more than you need to, either.
  • HTTPS is a must these days. You owe it to your users across the world to help stop people snooping on them wherever they are, and it helps you achieve better SEO rankings.
  • Choose a CDN that offers edge servers closest to your users. Check the main regions where your users will be accessing your website. Where are your subsidiaries located? Which markets do you serve most?
  • See what extra features a CDN offers, including automatic compression such as GZip or Brotli for smaller asset sizes (and faster loading times), notifications and analytics (for example, in Amazon CloudFront).

Examples from our experience

At b13, we’ve had good experience with CloudFlare, and we also use Fastly, CloudFront and Akamai. CloudFlare offers powerful DDoS protection, supports TYPO3 cache tags, and has a clear pricing structure. Fastly is great for configurability.

Two clients where we’ve used CDNs in the past couple of years are Texere and d&b audiotechnik.

Texere Publishing Ltd publishes a series of beautifully designed scientific journals, based in the UK but with readers throughout the worldwide scientific community. The nature of the content is inherently cacheable, as it’s largely static, and because it’s design-focused there are lots of images and other assets that are best served from an edge server. In addition, we're handling region-specific content, showing different (cached) content for the USA, Europe, Asia and other continents.

d&b audiotechnik is a German producer of high-end audio equipment for event locations. Operating out of the town of Backnang in southern Germany, they supply installers and event locations across the world. They, too, have a beautiful website with many images as well as downloadable assets such as product brochures. Their technicians need product information fast, which is why it works well caching it nearby, wherever they are in the world.

Why not deliver your content with a CDN?

CDNs have advanced leaps and bounds in recent years, and they’re improving all the time to reach ever greater heights of performance. They relieve your server, can even deliver dynamic content, and protect against DDoS attacks. The TYPO3 community and b13 are keeping up with this progress by leveraging state-of-the-art technology. For a reasonable monthly price, you may decide it’s worth handing over responsibility for your HTTP cache to a specialist provider.

Why not take the load off your server and your to-do list, and improve your website’s user experience in one go? We’re here to help!