Hello, I’m trying to host my React static website on digital ocean using App Platform. I’ve integrated it with gitlab, it deploys correctly but once I go and visit the website the page is completely blank.

The only error showed is that it cannot find the favicon on the public directory but other than that nothing else. Moreover if I host it on Firebase Hosting it works without issues.

I’ve followed different guides and looked all over the internet but couldn’t find anything.

Currently I’m using react-router-dom as for Routes with HashRouter

the command to run it is: npm run build

could anyone help me on this, I think I’m stuck at this point

–EDIT–

After waiting 30 minutes it got fixed by itself, now the page loads correctly. Of course before checking I cleaned my browser cache multiple time, is DigitalOcean caching the page?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

👋🏼 @MarcoCarnevali

With static sites, the page content is cached at the CDN level for 24 hours and at the browser level for 10 seconds (using the following cache-control header: public,max-age=10,s-maxage=86400).

However, at the end of each app deployment, the CDN cache is purged, so practically speaking, each page is cached for only 10 seconds.

If you see incorrect caching behavior, please open a support ticket and include a full request log with both the request and response headers (you can find them in your browser’s dev tools) + any other information that might be helpful.