# iOS doesn't load CSS sometimes when navigating between subdomains

**URL:** https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740
**Category:** Bug
**Tags:** ios
**Created:** [March 10, 2024, 10:15am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740 "2024-03-10T10:15:59Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [March 10, 2024, 10:15am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/1 "2024-03-10T10:15:59Z")

</div>

Only seem to happen on iOS devices - sometimes external links open to within the same window but CSS isn’t loading. Strange and I can’t even seem to reproduce!

Looks like this:

> [@Main CSS sometimes doesn't load](https://meta.discourse.org/t/main-css-sometimes-doesnt-load/95170):
>
> Hello discourse users! Did any of you have a css not loading problem? My discourse is installed on a digital ocean site at [http://talk.circuito.io](http://talk.circuito.io), and since a few days ago, after working fine for a long time and without any recent change, the css file: “[talk.circuito.io/stylesheets/desktop\_192206dbd504951abd51e329336bf10de9c56533.css?\_\_ws=talk.circuito.io](http://talk.circuito.io/stylesheets/desktop_192206dbd504951abd51e329336bf10de9c56533.css?__ws=talk.circuito.io)” which is the only css file being loaded, sometimes gets loaded and sometimes doesn’t. Of course when it doesn’t the site has no css. A…

Also found reports on other public discourse forums:

> **[✅ CSS on official site not loading in Safari iOS](https://community.postcrossing.com/t/css-on-official-site-not-loading-in-safari-ios/544503)**
>
> There seems to be an issue loading the CSS/styling on Safari/iOS. I’ve been getting this for the last day: I tried reloading the page a few times (although I have not tried clearing the cache). Other browsers/OS I looked at (Firefox/Windows...

> **[Why css is sometimes ignored?](https://discourse.gohugo.io/t/why-css-is-sometimes-ignored/22845/5)**
>
> Unfortunately this is not it. All requests from my web host are already served with TLS and all links are https already. 😕

Since it was reported and fixed before I wonder if it can be related to a theme or theme component maybe? Would appreciate any help.

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [March 10, 2024, 4:02pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/2 "2024-03-10T16:02:51Z")

</div>

What errors are shown in the network logs when the CSS fails to load?

As for it theoretically being a theme/component issue, have you tried [safe mode](https://meta.discourse.org/t/53504?silent=true)?

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [March 10, 2024, 4:27pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/3 "2024-03-10T16:27:32Z")

</div>

no simply because I saw this behaviour a few times in the last two weeks, only on my iPhone and have heard the same from users but cannot reproduce, seems random.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [March 10, 2024, 4:36pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/4 "2024-03-10T16:36:59Z")

</div>

this looks like an old bug. I can’t reproduce anywhere at the moment and all those linked topics are at least a year old. sounds like a forum that isn’t up to date.

> [@Main CSS sometimes doesn't load](https://meta.discourse.org/t/main-css-sometimes-doesnt-load/95170/2):
>
> Hey there, This was a bug that was fixed 12 days ago. [Meta & our own site looking css'less - #6 by sam](https://meta.discourse.org/t/meta-our-own-site-looking-cssless/94166/6) Please update your Discourse install.

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [March 10, 2024, 4:47pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/5 "2024-03-10T16:47:55Z")

</div>

Thanks, but it’s running the latest beta update ☹

What was fixed in that bug? I wonder if perhaps there’s a component or theme that re-generated this bug?

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [March 10, 2024, 4:49pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/7 "2024-03-10T16:49:37Z")

</div>

I’m trying to catch it again, it seems to happen occasionally - not sure how to repro. It does happen though, only in iOS afaik.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [March 10, 2024, 4:50pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/8 "2024-03-10T16:50:50Z")

</div>

I’m using multiple iOS devices, iphone 15 pro max, ipad Air 5th gen, Macbook Air M2 and I cannot reproduce this 🤔

What model of device and iOS version are you using?

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [March 10, 2024, 4:55pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/9 "2024-03-10T16:55:28Z")

</div>

personally iphone 12 with the latest iOS 17.4

It only happens for links outside using html a href but even then it happens occasionally only?

Would love to know what was the bug that was fixed - so perhaps I could try and trigger something to reproduce it 😕

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [March 10, 2024, 5:05pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/10 "2024-03-10T17:05:42Z")

</div>

> [@sok777](#):
>
> Also found reports on other public discourse forums

How do those reports relate to problems with the CSS of Discourse Forums? The first one explicitly states:

> the forum is not affected by this issue

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [March 10, 2024, 5:12pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/11 "2024-03-10T17:12:49Z")

</div>

It seems to be the same behaviour - it’s when opening an external website from within the discourse. For example, opening [https://discourse.org/](https://discourse.org/) from [meta.discourse.org](http://meta.discourse.org).

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [March 10, 2024, 5:19pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/12 "2024-03-10T17:19:36Z")

</div>

That doesn’t sound like a problem the forum is causing then, if external sites are having issues.

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [March 10, 2024, 5:22pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/13 "2024-03-10T17:22:58Z")

</div>

I thought so too, however it seems to only happen when clicking through from the forum and because I found other posts I thought maybe someone can shed a light on this - could be an iOS issue. Was easier if it was not loading CSS every time and just sometimes 😅

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [April 1, 2024, 9:21pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/14 "2024-04-01T21:21:20Z")

</div>

@Lilly I wonder if you could share how discourse handles href and if there’s any particular way for iOS? This seems to be a Safari related issue, but it only ever happens from within discourse going out to another domain. That other domain isn’t being loaded as if discourse is trying to locally load the html of the requested page.

We’ve already tried forcing no-cache policy and playing around with www prefix. nothing seem to work. It’s exactly the issues mentioned here:

> **[✅ CSS on official site not loading in Safari iOS](https://community.postcrossing.com/t/css-on-official-site-not-loading-in-safari-ios/544503)**
>
> There seems to be an issue loading the CSS/styling on Safari/iOS. I’ve been getting this for the last day: I tried reloading the page a few times (although I have not tried clearing the cache). Other browsers/OS I looked at (Firefox/Windows...

They had the main website load from their [community.URL.com](http://community.URL.com) which caused the same partial page load.

Thanks in advance!

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [May 20, 2024, 6:56am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/15 "2024-05-20T06:56:35Z")

</div>

Our discourse is a subdomain ([here.domain.com](http://here.domain.com)) for our main site ([domain.com](http://domain.com)).

For months now we’ve had iPhone users say that when clicking links from the sub domain (discourse) back to the main site, the page may not fetch CSS or JS but only HTML and therefore is unusable.

This does not happen every single time, but frequently enough so that they have to reload the page to fix it. By reloading they actually remain in discourse so they have to click again.

Looking at the access.log file of the nginx we can see that for some reason discourse tries to fetch the main domain files instead of index of the main domain.  
Needless to say, discourse does not have these files and so the page is then broken.

This is from “access.log” of the nginx:

```plaintext
[19/May/2024:09:49:51 +0000] "here.domain.com" 176.76.227.47 "GET /js/cart/cart.js?v=0.32 HTTP/2.0" "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Ribblr Mobile" "-" 429 230 "https://here.domain.com/c/testing/17" - 0.000 "-" "-" "-" "-" "-" "-" "-"

[19/May/2024:09:49:51 +0000] "here.domain.com" 176.76.227.47 "GET /css/footer_and_header.css?v=1.13 HTTP/2.0" "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Ribblr Mobile" "-" 404 7963 "https://here.domain.com/c/testing/17" 0.019 0.019 "-" "-" "-" "-" "-" "-" "-"
[19/May/2024:09:49:51 +0000] "here.domain.com" 176.76.227.47 "GET /css/common/jssocials.css?v=0.03 HTTP/2.0" "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Ribblr Mobile" "-" 404 7968 "https://here.domain.com/c/testing/17" 0.020 0.020 "-" "-" "-" "-" "-" "-" "-"
[19/May/2024:09:49:51 +0000] "here.domain.com" 176.76.227.47 "GET /js/common/lightslider.js?v=0.14 HTTP/2.0" "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Ribblr Mobile" "-" 404 7980 "https://here.domain.com/c/testing/17" 0.020 0.020 "-" "-" "-" "-" "-" "-" "-"
[19/May/2024:09:49:51 +0000] "here.domain.com" 176.76.227.47 "GET /js/common/jssocials.js HTTP/2.0" "Mozilla/5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Ribblr Mobile" "-" 404 7978 "https://here.domain.com/c/testing/17" 0.034 0.034 "-" "-" "-" "-" "-" "-" "-"

```

We tried using both href links and window.reload() but the issue remains the same. Once again, it only happens occasionally and only for iPhone users.

Any ideas why this happens and how it can be fixed?

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [May 20, 2024, 6:58am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/16 "2024-05-20T06:58:39Z")

</div>

Is this the same issue you described here?

> [@iOS doesn't load CSS sometimes when navigating between subdomains](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes/298740):
>
> Only seem to happen on iOS devices - sometimes external links open to within the same window but CSS isn’t loading. Strange and I can’t even seem to reproduce! Looks like this: Also found reports on other public discourse forums: Since it was reported and fixed before I wonder if it can be related to a theme or theme component maybe? Would appreciate any help.

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [May 20, 2024, 7:02am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/17 "2024-05-20T07:02:20Z")

</div>

yes! it needs to be merged 😅

I think we now understand better what is wrong.

---

<div class="post-metadata">

### Author: ![sok777](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@sok777](https://meta.discourse.org/u/sok777)
#### Post date: [May 21, 2024, 11:36am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/18 "2024-05-21T11:36:59Z")

</div>

Wondering if some team members have any thoughts? @Lilly I know we’ve discussed here a couple months ago - maybe you have additional insights to share?

I think it’s the same issue as the discourse website I shared on my first post.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [May 21, 2024, 11:55am UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/19 "2024-05-21T11:55:54Z")

</div>

We have observed some strange issues like this. As far as we can tell, it must be a bug in Safari/WebKit. It should be impossible for this kind of ‘mixed site’ rendering to happen. We have [filed a report with WebKit](https://bugs.webkit.org/show_bug.cgi?id=274310). (cc @pmusaraj)

If anyone can find a consistent way to reproduce the issue, that would almost certainly help to get the bug prioritised.

---

<div class="post-metadata">

### Author: ![Senior\_Avr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/senior_avr/32/210181_2.png) [@Senior\_Avr](https://meta.discourse.org/u/Senior_Avr)
#### Post date: [May 21, 2024, 2:51pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/20 "2024-05-21T14:51:03Z")

</div>

Any ideas for an external link workaround?  
Both HTML HREF and JS window.replace behave the same ☹  
(I’m sure the Fwd/Back are almost impossible to override)

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [May 21, 2024, 4:50pm UTC](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740/21 "2024-05-21T16:50:43Z")

</div>

Sadly, I don’t have any ideas for a workaround. I tried deregistering service workers in case that was the conflicting reason, but it had no effect.

Currently I have switched to Safari Technology Preview locally. It seems to not have the issue, which may be an indicator that this is fixed in newer versions of Webkit. Or, it means that a fresh browser with a fresh cache doesn’t have the issues… hard to say.

We will monitor this and keep looking for fixes, the issues affects multiple people in the Discourse team and on different platforms (macOS, iOS, DiscourseHub app). Short of finding a magic fix, though, the best we can do here is follow [the Webkit bug report](https://bugs.webkit.org/show_bug.cgi?id=274310) and add additional information there, if relevant/useful.

[Next page](https://meta.discourse.org/t/ios-doesnt-load-css-sometimes-when-navigating-between-subdomains/298740.md?page=2)
