-
-
Notifications
You must be signed in to change notification settings - Fork 994
Icons fail to load #1881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I can see icons on mobile 👍 I tested the website with Android 15 on Pixel 7. Chrome 132Firefox 134@sarahboyce what version of Phone/OS/Browser are you experiencing the issue? |
Android 14, Chrome 132 |
@sarahboyce Is this reproducible for you? I'm not exactly sure how assets work on production, but I'm assuming this is a one-time, cache-related thing. |
I still have this with cleared cache, it's been this way for a few days |
Is it the same if you try an incognito window or another browser like Firefox? I can't reproduce either 🤔 |
Works on incognito 👍 |
Ah, given your comment in #1887, it seems like a production configuration issue, right? I wonder why it's not happening for the rest of us though. |
Since the discussion seems to be happening here, this is @sarahboyce's comment from #1887 showing the console errors related to this issue:
The asset URL works fine for me. It's odd to me that For what it's worth, this header seems a bit odd to me too, but I should revisit the docs: ![]() Anyway, these are just initial ideas. I hope to have some time later this week to debug this if the solution is not obvious to someone else. |
I added a screenshot of the broken link for me and this is cached until Dec 2037. I wonder if @bmispelon can do anything here 🤔 |
This is definitely confusing 🤔 In case that helps, here's the relevant (I think) portion of the nginx configuration for
It seems that the response you're receiving have the wrong |
|
Cleared my cache on firefox, desktop this morning and the error is gone and icons load. I know have the correct Clearing the cache isn't working on mobile, I don't have access to errors to see what is going on there 🤔 |
Ah there's a "filter" on clearing data on mobile to only do the last 24 hours 🤦 |
I think I managed to reproduce the issue consistently with these steps (using Firefox on desktop):
When doing that, the icon that should be in the green box "Always refer to the documentation that corresponds to the version of Django you’re using!" is missing and replaced by a square box with 4 letters. My best understanding of the bug is that the browser is caching the font alongside the |
I wonder if this might be the issue we're seeing: https://stackoverflow.com/questions/44800431/caching-effect-on-cors-no-access-control-allow-origin-header-is-present-on-th If so, the fix suggested in the top answer is to tweak the I'll try that config change later today and see if that helps. |
@bmispelon Good find! Are you getting this on the document response when you go to https://www.djangoproject.com/ ? ![]() Does that seem correct? |
🎉 yes, this is it. |
The fix I did with the headers appears to be live (I even cleared the fastly cache), but unfortunately it doesn't seem to have fixed anything 😿 |
@bmispelon The browser is caching the response. EDIT:// Though even the expires might (?) exhibit the same problem mhm. I wonder if there is actually a fix for that. Anyways the bug your are running into is probably something along the lines of https://issues.chromium.org/issues/41470498 |
@bmispelon Got a better idea, can you try setting |
It is required to load the woff files at all which are subject to CORS. But simply allowing |
I have thought more about this. Even if we were to get the current approach working the browser would probably still recheck the font files when switching between docs & www. As such I recommend settings |
@apollo13 For what it's worth, this makes sense to me as well. I don't think we need to lock things down with this header. |
This should not have been closed by #1949...or was it actually fixed at the ops level? |
I'm not getting Roboto consistently on the production site, probably because of this issue. I mentioned in #1949 that we should address this issue before merging/deploying self-hosted fonts. Let me know if there's anything I can do to help address this! |
Same here. I see the font-face declarations for Roboto are missing in place where I'd expect them to be: ![]() I'm not sure if it's the same issue, but it does seem to be caching/CDN related because the code is already there: djangoproject.com/djangoproject/scss/_utils.scss Lines 46 to 95 in 2b81dae
Switching browsers and using incognito did not work. |
This is super weird and I don't really understand how it's possible. What seems to have happened is that we served the page with the new version of In any case, this should resolve itself once the cache clears. You can get get a non-cached version of the page by appending So that was a real issue, but separate from the original one 😁 |
@bmispelon I can imagine that happening if collectstatic isn't executed before the server starts in which case the staticfiles manifest might still have old data? |
@apollo13 I think you are onto something. We have a WIP PR on the private deployment repo to re-organize how deploy commands are run. I deployed from this branch last night. I wonder if someone could check to see if the bug is currently reproducible? |
@tobiasmcnulty For what it's worth, font and icon assets are fixed for me! |
I can confirm that the font loads properly for me too. (And the icons for that matter, but I don’t remember whether I had that issue or not.) |
@tobiasmcnulty |
@apollo13 I see, I can indeed reproduce that if I step away for a bit and come back. A force reload fixes it. We can change the header as you suggested, or even move away from the static.dp.com domain in favor of building the assets into the image and serving them with gunicorn from |
I changed the header so we can see if that fixes it:
Either way, I'd still be grateful for any feedback on the |
If the separate domain isn't benefitting the site, I don't see the point in keeping it. I'm not on the ops team though, so I don't know all the details. |
Getting rid of the static subdomain makes sense if www. and docs. don't share a Cache in the browser because then you'd download the font etc twice anyways. If they share one (which I somewhat suspect) then the subdomain is good (will check later whether they share the cache entry or not).
…On Fri, Mar 7, 2025, at 02:33, Tobias McNulty wrote:
@apollo13 <https://github.com/apollo13> I see, I can indeed reproduce
that if I step away for a bit and come back. A force reload fixes it.
We can change the header as you suggested, or even move away from the
static.dp.com domain in favor of building the assets into the image and
serving them with gunicorn. Everything is behind Fastly now, so the
separate domain and build step feel like unnecessary complexity. What
do you think?
—
Reply to this email directly, view it on GitHub
<#1881 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAT5C4ZMGLDEDZF4MMU3Z32TDZNTAVCNFSM6AAAAABVOZKMVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBVGMYTCNRTGQ>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
tobiasmcnulty*tobiasmcnulty* left a comment
(django/djangoproject.com#1881)
<#1881 (comment)>
@apollo13 <https://github.com/apollo13> I see, I can indeed reproduce
that if I step away for a bit and come back. A force reload fixes it.
We can change the header as you suggested, or even move away from the
static.dp.com domain in favor of building the assets into the image and
serving them with gunicorn. Everything is behind Fastly now, so the
separate domain and build step feel like unnecessary complexity. What
do you think?
—
Reply to this email directly, view it on GitHub
<#1881 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAT5C4ZMGLDEDZF4MMU3Z32TDZNTAVCNFSM6AAAAABVOZKMVOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBVGMYTCNRTGQ>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@apollo13 Good point, yes, they do share the browser cache (wasn't that the issue?). In fact, I still had a stray font in my browser cache with the old header this morning, and it didn't load for me until after a force-refresh. @adamzap @bmispelon Perhaps we should also change $font-path or add a query string to each font path to force browsers to reload the fonts now that the header is changed? They are set to cache forever, so until the path changes or they are force-reloaded, I think browsers will happily continue using their local copy.
|
Ah yes, I have lost track of what is cached where now :D |
@tobiasmcnulty That's a good idea. I can think of two approaches that should both create a cache invalidation for users and maybe even increase consistency in our static assets:
We could also just add @bmispelon Any thoughts? I'd be happy to open a PR for this once we decide on an approach. I may lean toward doing both of the renaming changes above, but I defer to you. |
@adamzap All these should have the same cache-busting effect indeed. I'd say option 1 is marginally better, since it requires the least amount of change I believe. |
I've deployed the changes suggested by Tobias in #1881 (comment) (thanks to a fast response by Adam). As far as I can tell, this issue is now completely fixed, no? |
Looks good to me so far! |
Noticed that icons are not loading on djangoproject.com (at least for me: on desktop, firefox, on mobile Chrome, Android).
They work on code.djangoproject.com and docs.djangoproject.com for mobile, they work in incognito mode 👍
Errors:
Screenshots with broken icons
Desktop:
Mobile:
The text was updated successfully, but these errors were encountered: