Fonts loaded from cache are missing from DevTools network tab
Categories
(DevTools :: Netmonitor, defect, P3)
Tracking
(Not tracked)
People
(Reporter: jon.rimmer, Unassigned)
References
(Blocks 1 open bug)
Details
Reporter | ||
Updated•11 years ago
|
Comment 1•10 years ago
|
||
Comment 2•8 years ago
|
||
Updated•7 years ago
|
Updated•6 years ago
|
Comment 3•6 years ago
|
||
Comment 4•5 years ago
|
||
I am able to reproduce the problem using the following STR:
- Load https://www.coca-cola.co.uk/stories/history/advertising/the-logo-story
- Open the DevTools.
- Activate the network tab, select the 'Fonts' filter
- Reload the page.
- Initial font requests will show up, but they are not there if the page is reloaded
If the Disable Cache
is selected font requests are back.
Honza
Comment 5•5 years ago
|
||
@Valentin: it looks like that when loading the page for the first time font requests have cause type "font" and when reloading some of them have cause type "stylesheet" and some of the request slooks like the are loaded directly from the cache and there is no HTTP event. I am not event seeing http-on-examine-cached-response events.
Is this expected behavior?
Honza
Comment 6•5 years ago
|
||
(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #5)
@Valentin: it looks like that when loading the page for the first time font requests have cause type "font" and when reloading some of them have cause type "stylesheet" and some of the request slooks like the are loaded directly from the cache and there is no HTTP event. I am not event seeing http-on-examine-cached-response events.
Is this expected behavior?
I am not sure exactly how fonts are loaded through Necko.
From what I can see we have a FontCache in GFX, and Anne tells me that the caching goes through DOM/layout somehow.
Let's see if Jonathan can provide some insight here.
Comment 7•5 years ago
|
||
(In reply to Valentin Gosu [:valentin] (he/him) from comment #6)
From what I can see we have a FontCache in GFX,
That's not the cache you're looking for...
Let's see if Jonathan can provide some insight here.
I think what's relevant here is the gfxUserFontSet::UserFontCache, which sits above any necko-level caching and directly returns ready-to-use platform font instances to gfx without re-requesting resources from the network layer. This is important for page-load/reflow performance when the same font resource is reused across multiple pages of a site, but it means that if the same resource is used repeatedly (by the same site), you won't see fresh network requests each time for fonts that are already cached at this level.
Simply re-fetching the resources from a networking-level cache would be significantly less performant because we'd still pay the cost of re-analyzing the resource and instantiating a new platform font instance.
I suppose if this is considered a bug, we could fire off the network request, and if we get back a 304 Not Modified response, then check if there's an already-instantiated font in the UserFontCache. I'd be concerned this still adds extra overhead/latency, though, especially if the network layer is busy with other requests and may take some time to even respond with 304.
Updated•2 years ago
|
Comment 9•2 years ago
|
||
A needinfo is requested from the reporter, however, the reporter is inactive on Bugzilla. Closing the bug as incomplete.
For more information, please visit auto_nag documentation.
Comment 10•2 years ago
|
||
I can still repro on my machine using STRs from comment #4
Comment 11•2 years ago
|
||
Honza, the patch on bug 1814961 landed earlier today and the latest Firefox Nightly build contains the fix. Would you mind checking if you can still reproduce the problem?
Comment 12•2 years ago
|
||
I can still repro the issue.
I believe that the comment #7 explains the state accuratelly. The font is loaded from gfxUserFontSet::UserFontCache, which represents another cache (for optimization) and so, we don't see any network not browser cache activity.
Description
•