Web Homepage Repeated Rendering Issue after Domain Resolution

Problem

There is a problem with repeated rendering on the homepage. The issue occurs when accessing the website through a custom domain after deploying it using GitHub and utilizing Cloudflare for hosting.

Expected Behavior

The homepage should render correctly without any duplication, both in local development mode and after domain resolution.

Actual Behavior

Upon accessing the website through the custom domain, the homepage is observed to render multiple times, resulting in duplicate content.

![image](https://github.com/jsrac/qionglou/assets/57232813/4c5be6dc-2603-47c0-9726-d8bd647b63f7)

Steps to Reproduce

1. Access the website using the custom domain (e.g., https://lib.jiangxue.org/).
1.1 https://qionglou.pages.dev/ is normal, and their deployment environments are the same, except that one is Cloudflare's domain name and the other is a custom domain name.
1.2 The DNS resolution type of jiangxue.org is `CNAME`, and the name is `lib` (that is, the second-level domain name lib.jiangxue.org), which points to `qionglou.pages.dev`
3. Observe the rendering of the homepage and note the presence of duplicate content.

Environment

  • Local Development Mode: No
  • Deployment Method: GitHub+Cloudflare
  • Hosting Provider: Cloudflare

Additional Information

Please note that the issue does not occur in local development mode or after direct deployment without domain resolution.

Source code

https://github.com/jsrac/qionglou/blob/main/docs/docs/.vitepress/theme/Home.vue
https://github.com/jsrac/qionglou/blob/main/docs/docs/index.md

I’m really eager to know the reason behind this issue because accessing qionglou.pages.dev renders correctly, whereas accessing my custom domain lib.jiangxue.org results in incorrect rendering. Here are my DNS settings:

![image|690x352](upload://obh0xs4gaazCeGiydFVcjWf6vWH.png)

If the issue cannot be resolved, I believe using qionglou.pages.dev is still a good option as it saves me money on the domain, and I would like to express my gratitude for the services provided by Cloudflare

I enabled the ‘Developer Mode’ and cleared the cache, which seems to have resolved the issue. Although this problem persisted for a week, I initially thought it was due to my coding skills. However, it appears that some services were not configured correctly, and I want to express my gratitude to Cloudflare for their assistance.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.