How we add CDN In frontity site?

Hi friends,

Please help me how we implement CDN in frontity code.

Any change required from WordPress site or only frontity code?


This is something you have to do in WordPress, although the plugin has to be able to modify the URL’s in the REST API (so no HTML replace scripts, which some do).

If you have custom assets in your Frontity project (styles, scripts, images) than you need to handle those manually.

You can also take a look at systems like Cloudflare, which can handle a lot of stuff without a lot of work, and works with Frontity perfectly.

Thanks For reply me @Johan

You mean we will change in our frontity code for this and replace url with CDN.

Any reference available for this?

You could use a custom Image component which replaces the URL with the URL of your CDN, however this still means you’ll need to manually push the files to your CDN. Normally this is done with a plugin in WordPress which pushes all files to the CDN and replaces the URL’s on your site.

If you use Vercel for hosting your Frontity application it should come with a CDN already (or can be bought separately, no idea, I host everything myself).

So unless you know exactly how it works I would suggest using Cloudflare (or similar) and ignore everything else.

@bhagvan.vrinsofts, this section in the docs may help you on this