Setting up a DatoCMS + Next.js site inside mainland China

We are trying to solve hosting webpage in the mainland China, but we are stuck with the assets. So our current idea is as follows:

  1. Setup a Next.js site in China (Alibaba cloud)

  2. Export all DatoCMS assets and copy them to Chinese CDN

  3. Build Next.js site and replace all DatoCMS links with Chinese CDN links

  4. Copy build files to Alibaba cloud

My question is will DatoCMS React Image component work if we replace dato CDN links? If I am correct we need to replace all links to https://www.datocms-assets.com/

Hello @primoz.rome

Depending on the plan of the project we offer some possibilities to return a different URL on asset requests, can you contact us at support@datocms.com with the project you want to do this on? This way we can forward you to the sales team and see the possibilities for your use case

1 Like

let me add my 2cents here:

our image component won’t work perfectly as it relies on the automatic resizes/optimizations provided by Imgix. So either you are going to point to a static file and always the original image/encoding to your users, or if NextJS works in the server there you might be able to leverage the Next Image component, that does something similar to what we do and save the cached versions on a local folder. Maybe you can do something clever there and maintain a cache in China?

@mat_jack1 That’s difficult then. We are using Dato’s Image component all over, which means we would have to replace it and find something else that works, which is not exactly what I want to do.

I have sent you and email…

1 Like