How to speed up your Typo3 website with BunnyCDN

This article contains an easy, step-by-step guide on how to speed up your Typo3 website with BunnyCDN. Typo3 comes with CDN support via a very easy to install plugin.

1. Create a Pull Zone for your website

In order to be able to use BunnyCDN to accelerate your Typo3 website, we need to first set up a Pull Zone inside BunnyCDN.

Ensure that you use the protocol that matches your website address exactly otherwise, you will get errors. If you deploy HTTPS on your main Typo3 website, enable HTTPS on your BunnyCDN zone. If you deploy an HTTP only site, deploy a BunnyCDN zone without HTTPS. We have a guide on how to deploy a BunnyCDN Pull Zone.

2. Installing the CDN plugin 

The next step you need to do is install the "Content Replacer" plugin on your site. It is this that will rewrite all of the content URLs on your site to serve them through BunnyCDN. We are going to use the Content Replacer plugin to do this. 

There are 2 ways you can do this. If your Typo3 install is in Compser mode, then you will need to use the Composer CLI tool on your server to install the plugin using the command:

composer req jweiland/replacer

If using the composer, once you seen an output like the above then composer has finished installing the plugin. 

The other method is to use the Extension Manger within Typo3 Web UI. 

3. Configuring the Typo3 Content Replacer

Once you've installed the plugin, we now need to edit the site template to add some lines to the configuration so that the plugin rewrites the right URLs. To do this, go to Template (1), select the root (2), enable Modify (3), and then Edit the entire template record (4):

On the "Edit Template" page, scroll down to the Setup box, and paste in the code below, substituting YOURZONE.b-cdn.net for the Pull Zone you configured earlier:

config.tx_ja_replacer {
    search {
        1="typo3temp/
        2="fileadmin/
        3=”typo3conf/
    }

    replace {
        1="https://YOURZONE.b-cdn.net/typo3temp/
        2="https://YOURZONE.b-cdn.net/fileadmin/
        3="https://YOURZONE.b-cdn.net/typo3conf/
    }
}

Once you've done this, press the Save button at the top (1), and then press the lightning bolt (2), and then click "Flush all caches" (3):

Congratulations, you've successfully deployed BunnyCDN on your Typo3 website. You'll now enjoy a much faster website for your global audience, as well as a saving on bandwidth costs. 

Table of Contents

Was this article helpful?
2 out of 3 found this helpful