Content Not loaded when accessing with www

I have deployed an app to Cloudflare Pages and set a custom domain yhimsical.com
The domain is managed with Cloudflare.

The issue is when the site is accessed through https://www.yhimsical.com it loads the first time fine. But when you reload the page, the content is loaded through service worker and the Content-Security-Policy is not correct. As a result, none of the scripts, fonts, styles are being loaded. When you hard reload the page, the issue is not there. But refresh the page again and same issue happens.

Here is the CSP errors I get when I access the site with www:

Wrong CSP headers when accessed the site with www:
https://i.imgur.com/WH2s8DM.png

When the site is accessed without the www part, the Correct CSP headers is loaded and everything works fine:
https://i.imgur.com/Gn2602m.png

Any help would be appreciated.

Best Regards

This screenshot shows the 200 status was returned from a service worker not the server.

When I load both sites (neither of which I have accessed previously) I see the same headers

1 Like

Okay. The www site was working fine on all other browsers.
Upon further inspection, looks like a browser caching issue. Clearing some cache from the devtool’s "Application"tab seems to have the issue.

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