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

HI @primoz.rome ,
just out of curiosity, did you managed to deploy on Alibaba Cloud and using DatoCMS? Does it works flawlessly?
Iā€™m estimating a new project for China and Iā€™d love to use DatoCMS, but Iā€™m not sure if the Great Firewall allows itā€¦

Iā€™ll greatly appreciate your reply :slight_smile:

Thanks
Marcello

No we were not yet successful about how to do that. Basically we are stuck with assets as those are served from imgix who donā€™t have a distribution location within China. If you are not using those, then it should be pretty straight forwardā€¦

Just wanted to chime in here with our own experience, too.

We do not have an official presence in China. Our services sometimes work there, but sometimes the Great Firewall does get in the way :frowning: It is unfortunately a ā€œuse at your own riskā€ situation (in terms of reliability and accessibility).

A VPN might help (for your content editors and devs, at least), but ultimately your frontend host has to be able to reach our servers, or our service will be useless for you. And your visitors need to be able to access your assets (uploads), which as @primoz.rome noted, may not always work.

We do have a free plan that uses the same data centers, so you should be able to spin up a demo instance and try DatoCMS for yourself before subscribing to anything. However, please be aware that access through the Great Firewall may change without notice, and even if itā€™s working today, it may suddenly break at some point in the future, and we have no real control over that.

To really do this right would require a presence within China, a negotiation with a local business there, and approval from the Chinese government. It is not something we currently have the capacity to handle ā€œofficiallyā€. If that ever changes, weā€™ll be sure to make an announcement.

In the meantime, please proceed very carefully if you choose to do this, do thorough testing, and have a backup plan in case the services are ever inaccessible.