This article describes how to enable our Google Cloud powered Templ CDN for static files, such as images.

Content of this article:

  1. Activate CDN in the Templ panel

  2. Enable CDN on your site

  3. Verify that resources are loading from CDN

  4. FAQ - Questions and answers

Activate CDN in the Templ panel

The first step is to activate CDN in the Templ panel. Only Templ support can do this at at the moment, but we do plan to make this available for everyone in our panel in the future.

Simply send us a message using the chat in the bottom right corner and let us know which site you would like to enable Templ CDN on and we'll help you out.

Enable CDN on your site

Once the CDN is activated in the Templ panel, we'll automatically install and activate a plugin called CDN Enabler on your site.

The correct CDN address needs to be entered in the CDN Enabler plugin settings. Remember to save your settings and empty cache on the site afterwards.

Replace 1234 with your site's actual ID number from our panel. Remember to clear cache afterwards.

Disable CDN

To disable CDN, deactivate the CDN Enabler plugin and then clear cache.


Verify that resources load from CDN

To make sure that CDN is enabled on your site you can take a look in the network tab of the Dev Console in Chrome. Check if images or other resources now are loading from the CDN address like this:

FAQ - Questions and answers

Q: Should I be using a CDN?

A: If you have a global audience with traffic to your site from all over the world, then we recommend using CDN.

If your site gets local traffic only and your site is hosted in, or near, the country of your target audience, then CDN is not a necessity.

Q: Does Templ CDN cost extra?
A: No. Templ CDN is included in each of our plans.

Q: I've updated a file on my site but it doesn't update on the CDN, how do I fix that?
A: This is likely due to browser cache. We have written an article on how to tackle those kinds of problems properly, this solution can be a bit advanced for some. Another solution is to install and activate the plugin Prevent Browser Cache which will do the same as the described in the article.

Q: How do I flush the CDN cache?
A: The CDN cache should not need to be flushed. If you have issues with your site not showing changes after you have made updates, please try the trick from the answer above. If you still need help, please reach out to our support.

Q: What are the benefits of using Cloudflare? What are the benefits of using Templ CDN?

A: Both Templ CDN and Cloudflare CDN are two great CDNs. Below is a breakdown the benefits of each CDN.

Benefits of using Templ CDN:

  • Fast CDN powered by Google Cloud

  • Works with our WebP solution (Cloudflare does not).

  • Solves GTMetrix "Cookie free domain" complaint (Cloudflare does not).

  • Doesn't require a DNS change.

Benefits of using Cloudflare:

  • Fast and free CDN, saves bandwidth

  • Free security features

Sometimes Templ CDN is more suitable for a site while in other cases Cloudflare will be more suitable. If you have a site with high bandwidth usage then it would make more sense to use Cloudflare since they offer CDN for free, which will help reduce bandwidth costs.

In other cases we recommend using our Templ CDN. It is also easier for us provide support for, and help set up our own CDN. 😎

-----------------------------------------------------------------------------------------------------------------------------

Related articles

-----------------------------------------------------------------------------------------------------------------------------

Did this answer your question?