Closed Bug 1432660 Opened 6 years ago Closed 6 years ago

link rel="preload": font is fetched twice

Categories

(Core :: Networking, defect)

57 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1394778

People

(Reporter: thilo-wolf, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0
Build ID: 20171003144318

Steps to reproduce:

0.) activate <link rel="preload"> elements in about:config / network.preload.
1.) open Tools / Web Developer / Network or press ctrl+shift+e
2.) visit page https://www.tierphysiotherapie-weissetaube.de/beta2/intro1/ which uses the element to preload a font while at the same time using the font in an external css via @font-face{src:url()}.



Actual results:

The font is fetched two times.

This bug is probably not related to https://bugzilla.mozilla.org/show_bug.cgi?id=1306892 as it can be triggered when opening the Network Monitor directly via ctrl+shift+e

Tested on linux with FF52 ESR, FF56, FF57 and FF Dev.


Expected results:

The font should only be fetched once. The request in the css file should hit the cache.
This works in chromium 63.
Component: General → Developer Tools: Style Editor
Product: Core → Firefox
I am sorry, but this bug is most certainly *not* related to the Developer Tools.
As I said in my original bug report this happens when opening the Network Monitor directly as opposed to the bug that I have linked.

But I forget to mention, that it actually happens without opening any Developer Tools at all. This can easily be verified by looking at server logs.
Thanks thilo-wolf, moving this to networking for investigation then.
Component: Developer Tools: Style Editor → Networking
Product: Firefox → Core
Thank you! Just as I was in the process of writing a follow up comment. 

I have noticed that my instructions were wrong and misleading. I am very sorry.

The bug actually only seems to appear when hitting ctrl+f5, if the page has been opened before but was closed or if the page is already open in the reloading tab.
It does not happen if the browsers cache was cleared in about:preferences#privacy.

I did not notice this until a few hours ago and this actually makes me want to implement preload on all of my pages right now because it is not that important - at least to me - if it only happens with a cleared cache.
(_Probably_ anonymous/non-anonymous cache separation, but could also be a preload bug.)
This is not an anon/non-anon separation problem.

I can see two channels open.  One is opened from:

>	xul.dll!mozilla::net::HttpChannelChild::AsyncOpen(0x000001c69d295b20, 0x0000000000000000) Line 2453	C++	Symbols loaded.
 	xul.dll!mozilla::net::HttpChannelChild::AsyncOpen2(0x000001c69ec51980) Line 2565	C++	Symbols loaded.
 	xul.dll!nsPrefetchNode::OpenChannel() Line 180	C++	Symbols loaded.
 	xul.dll!nsPrefetchService::Preload(0x000001c69a1f5000, 0x000001c69a1f4900, 0x000001c69d294dd0, 14) Line 773	C++	Symbols loaded.
 	xul.dll!nsPrefetchService::PreloadURI(0x000001c69a1f5000, 0x000001c69a1f4900, 0x000001c69d294dd0, 14) Line 961	C++	Symbols loaded.
 	xul.dll!mozilla::dom::Link::TryDNSPrefetchOrPreconnectOrPrefetchOrPreloadOrPrerender() Line 172	C++	Symbols loaded.
 	xul.dll!mozilla::dom::HTMLLinkElement::BindToTree(0x000001c69ec16000, 0x000001c69b07e670, 0x0000000000000000, true) Line 140	C++	Symbols loaded.
 	xul.dll!nsINode::doInsertChildAt(0x000001c69d294d50, 7, false, {...}) Line 1625	C++	Symbols loaded.
 	xul.dll!mozilla::dom::FragmentOrElement::InsertChildAt_Deprecated(0x000001c69d294d50, 7, false) Line 1167	C++	Symbols loaded.
 	xul.dll!nsINode::AppendChildTo(0x000001c69d294d50, false) Line 764	C++	Symbols loaded.
 	xul.dll!nsHtml5TreeOperation::Append(0x000001c69d294d50, 0x000001c69b07e670, 0x000001c69f30d400) Line 183	C++	Symbols loaded.
 	xul.dll!nsHtml5TreeOperation::Perform(0x000001c69f30d400, 0x000000aef6bfe730, 0x000000aef6bfe6f4, 0x000000aef6bfe6f0) Line 825	C++	Symbols loaded.
 	xul.dll!nsHtml5TreeOpExecutor::RunFlushLoop() Line 493	C++	Symbols loaded.
 	xul.dll!nsHtml5ExecutorFlusher::Run() Line 133	C++	Symbols loaded.
 	xul.dll!mozilla::SchedulerGroup::Runnable::Run() Line 395	C++	Symbols loaded.
 	xul.dll!nsThread::ProcessNextEvent(false, 0x000000aef6bfef82) Line 1041	C++	Symbols loaded.
 	xul.dll!NS_ProcessNextEvent(0x000001c6951061f0, false) Line 517	C++	Symbols loaded.
 	xul.dll!mozilla::ipc::MessagePump::Run(0x000000aef6bff4f0) Line 97	C++	Symbols loaded.
 	xul.dll!mozilla::ipc::MessagePumpForChildProcess::Run(0x000000aef6bff4f0) Line 302	C++	Symbols loaded.
 	xul.dll!MessageLoop::RunInternal() Line 327	C++	Symbols loaded.
 	xul.dll!MessageLoop::RunHandler() Line 320	C++	Symbols loaded.
 	xul.dll!MessageLoop::Run() Line 300	C++	Symbols loaded.
 	xul.dll!nsBaseAppShell::Run() Line 159	C++	Symbols loaded.
 	xul.dll!nsAppShell::Run() Line 344	C++	Symbols loaded.
 	xul.dll!XRE_RunAppShell() Line 873	C++	Symbols loaded.
 	xul.dll!mozilla::ipc::MessagePumpForChildProcess::Run(0x000000aef6bff4f0) Line 269	C++	Symbols loaded.
 	xul.dll!MessageLoop::RunInternal() Line 327	C++	Symbols loaded.
 	xul.dll!MessageLoop::RunHandler() Line 320	C++	Symbols loaded.
 	xul.dll!MessageLoop::Run() Line 300	C++	Symbols loaded.
 	xul.dll!XRE_InitChildProcess(15, 0x000001c695104020, 0x000000aef6bff6a0) Line 703	C++	Symbols loaded.




--------------------------


The second one from:

>	xul.dll!mozilla::net::HttpChannelChild::AsyncOpen(0x000001c69ec74160, 0x0000000000000000) Line 2453	C++	Symbols loaded.
 	xul.dll!mozilla::net::HttpChannelChild::AsyncOpen2(0x000001c69f334d60) Line 2565	C++	Symbols loaded.
 	xul.dll!mozilla::dom::FontFaceSet::StartLoad(0x000001c69d34a5e0, 0x000001c69f34cf18) Line 712	C++	Symbols loaded.
 	xul.dll!mozilla::dom::FontFaceSet::UserFontSet::StartLoad(0x000001c69d34a5e0, 0x000001c69f34cf18) Line 1920	C++	Symbols loaded.
 	xul.dll!gfxUserFontEntry::DoLoadNextSrc(false) Line 627	C++	Symbols loaded.
 	xul.dll!gfxUserFontEntry::LoadNextSrc() Line 452	C++	Symbols loaded.
 	xul.dll!gfxUserFontEntry::Load() Line 846	C++	Symbols loaded.
 	xul.dll!gfxFontGroup::GetFirstValidFont(32) Line 2108	C++	Symbols loaded.
 	xul.dll!gfxFontGroup::MakeSpaceTextRun(0x000000aef6bf27b0, 102, 336) Line 2195	C++	Symbols loaded.
 	xul.dll!gfxFontGroup::MakeTextRun(0x000000aef6bf3a80, 1, 0x000000aef6bf27b0, 102, 336, 0x0000000000000000) Line 2297	C++	Symbols loaded.
 	xul.dll!BuildTextRunsScanner::BuildTextRunForFrames(0x000000aef6bf3a81) Line 2413	C++	Symbols loaded.
 	xul.dll!BuildTextRunsScanner::FlushFrames(true, false) Line 1699	C++	Symbols loaded.
 	xul.dll!BuildTextRuns(0x000001c6951244a0, 0x000001c69d366360, 0x000001c69d366220, 0x000000aef6bf8610, eNotInflated) Line 1626	C++	Symbols loaded.
 	xul.dll!nsTextFrame::EnsureTextRun(eNotInflated, 0x000001c6951244a0, 0x000001c69d366220, 0x000000aef6bf8610, 0x000000aef6bf720c) Line 2873	C++	Symbols loaded.
 	xul.dll!nsTextFrame::AddInlineMinISizeForFlow(0x000001c69d3a8700, 0x000000aef6bf8658, eNotInflated) Line 8523	C++	Symbols loaded.
 	xul.dll!nsTextFrame::AddInlineMinISize(0x000001c69d3a8700, 0x000000aef6bf8658) Line 8692	C++	Symbols loaded.
 	xul.dll!nsContainerFrame::DoInlineIntrinsicISize(0x000001c69d3a8700, 0x000000aef6bf8658, MIN_ISIZE) Line 806	C++	Symbols loaded.
 	xul.dll!nsInlineFrame::AddInlineMinISize(0x000001c69d3a8700, 0x000000aef6bf8658) Line 262	C++	Symbols loaded.
 	xul.dll!nsBlockFrame::GetMinISize(0x000001c69d3a8700) Line 762	C++	Symbols loaded.
 	xul.dll!nsLayoutUtils::IntrinsicForAxis(eAxisHorizontal, 0x000001c69d3a8700, 0x000001c69d366220, MIN_ISIZE, {...}, 0, 1073741823) Line 5520	C++	Symbols loaded.
 	xul.dll!nsLayoutUtils::IntrinsicForContainer(0x000001c69d3a8700, 0x000001c69d366220, MIN_ISIZE, 0) Line 5655	C++	Symbols loaded.
 	xul.dll!nsTableCellFrame::GetMinISize(0x000001c69d3a8700) Line 766	C++	Symbols loaded.
 	xul.dll!GetISizeInfo(0x000001c69d3a8700, 0x000001c69d366170, {...}, true) Line 99	C++	Symbols loaded.
 	xul.dll!GetCellISizeInfo(0x000001c69d3a8700, 0x000001c69d366170, {...}) Line 243	C++	Symbols loaded.
 	xul.dll!BasicTableLayoutStrategy::ComputeColumnIntrinsicISizes(0x000001c69d3a8700) Line 319	C++	Symbols loaded.
 	xul.dll!BasicTableLayoutStrategy::ComputeIntrinsicISizes(0x000001c69d3a8700) Line 430	C++	Symbols loaded.
 	xul.dll!BasicTableLayoutStrategy::GetMinISize(0x000001c69d3a8700) Line 50	C++	Symbols loaded.
 	xul.dll!nsTableFrame::GetMinISize(0x000001c69d3a8700) Line 1793	C++	Symbols loaded.
 	xul.dll!nsTableFrame::TableShrinkISizeToFit(0x000001c69d3a8700, 75780) Line 1871	C++	Symbols loaded.
 	xul.dll!nsTableFrame::ComputeAutoSize(0x000001c69d3a8700, {...}, {...}, 75780, {...}, {...}, {...}, eShrinkWrap) Line 1907	C++	Symbols loaded.
 	xul.dll!nsFrame::ComputeSize(0x000001c69d3a8700, {...}, {...}, 75780, {...}, {...}, {...}, eShrinkWrap) Line 5591	C++	Symbols loaded.
 	xul.dll!nsTableFrame::ComputeSize(0x000001c69d3a8700, {...}, {...}, 75780, {...}, {...}, {...}, eShrinkWrap) Line 1845	C++	Symbols loaded.
 	xul.dll!nsTableWrapperFrame::ChildShrinkWrapISize(0x000001c69d3a8700, 0x000001c69d365f18, {...}, {...}, 75780, 0x0000000000000000) Line 425	C++	Symbols loaded.
 	xul.dll!nsTableWrapperFrame::ComputeAutoSize(0x000001c69d3a8700, {...}, {...}, 75780, {...}, {...}, {...}, eShrinkWrap) Line 455	C++	Symbols loaded.
 	xul.dll!nsFrame::ComputeSize(0x000001c69d3a8700, {...}, {...}, 75780, {...}, {...}, {...}, eShrinkWrap) Line 5591	C++	Symbols loaded.
 	xul.dll!mozilla::ReflowInput::InitConstraints(0x000001c69c4dc000, {...}, 0x0000000000000000, 0x0000000000000000, TableWrapper) Line 2545	C++	Symbols loaded.
 	xul.dll!mozilla::ReflowInput::Init(0x000001c69c4dc000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000) Line 428	C++	Symbols loaded.
 	xul.dll!mozilla::ReflowInput::ReflowInput(0x000001c69c4dc000, {...}, 0x000001c69d365e80, {...}, 0x0000000000000000, 0) Line 260	C++	Symbols loaded.
 	xul.dll!nsFlexContainerFrame::GenerateFlexItemForChild(0x000001c69c4dc000, 0x000001c69d365e80, {...}, {...}) Line 1222	C++	Symbols loaded.
 	xul.dll!nsFlexContainerFrame::GenerateFlexLines(0x000001c69c4dc000, {...}, 1073741823, 1073741823, {...}, {...}, {...}, {...}) Line 3752	C++	Symbols loaded.
 	xul.dll!nsFlexContainerFrame::DoFlexLayout(0x000001c69c4dc000, {...}, {...}, {...}, 1073741823, 1073741823, {...}, {...}) Line 4362	C++	Symbols loaded.
 	xul.dll!nsFlexContainerFrame::Reflow(0x000001c69c4dc000, {...}, {...}, {...}) Line 4165	C++	Symbols loaded.
 	xul.dll!nsBlockReflowContext::ReflowBlock({...}, true, {...}, 0, true, 0x000001c69f3fe818, {...}, {...}, {...}) Line 307	C++	Symbols loaded.
 	xul.dll!nsBlockFrame::ReflowBlockFrame({...}, {...}, 0x000000aef6bfaea3) Line 3472	C++	Symbols loaded.
 	xul.dll!nsBlockFrame::ReflowLine({...}, {...}, 0x000000aef6bfaea3) Line 2815	C++	Symbols loaded.
 	xul.dll!nsBlockFrame::ReflowDirtyLines({...}) Line 2355	C++	Symbols loaded.
 	xul.dll!nsBlockFrame::Reflow(0x000001c69c4dc000, {...}, {...}, {...}) Line 1237	C++	Symbols loaded.
 	xul.dll!nsContainerFrame::ReflowChild(0x000001c69d365d40, 0x000001c69c4dc000, {...}, {...}, {...}, {...}, {...}, 0, {...}, 0x0000000000000000) Line 946	C++	Symbols loaded.
 	xul.dll!nsCanvasFrame::Reflow(0x000001c69c4dc000, {...}, {...}, {...}) Line 765	C++	Symbols loaded.
 	xul.dll!nsContainerFrame::ReflowChild(0x000001c69d3650b0, 0x000001c69c4dc000, {...}, {...}, {...}, {...}, {...}, 3, {...}, 0x0000000000000000) Line 946	C++	Symbols loaded.
 	xul.dll!nsHTMLScrollFrame::ReflowScrolledFrame(0x000000aef6bfc550, false, true, 0x000000aef6bfc380, true) Line 556	C++	Symbols loaded.
 	xul.dll!nsHTMLScrollFrame::ReflowContents(0x000000aef6bfc550, {...}) Line 698	C++	Symbols loaded.
 	xul.dll!nsHTMLScrollFrame::Reflow(0x000001c69c4dc000, {...}, {...}, {...}) Line 1054	C++	Symbols loaded.
 	xul.dll!nsContainerFrame::ReflowChild(0x000001c69d365158, 0x000001c69c4dc000, {...}, {...}, 0, 0, 0, {...}, 0x0000000000000000) Line 989	C++	Symbols loaded.
 	xul.dll!mozilla::ViewportFrame::Reflow(0x000001c69c4dc000, {...}, {...}, {...}) Line 337	C++	Symbols loaded.
 	xul.dll!mozilla::PresShell::DoReflow(0x000001c69d365020, true) Line 8978	C++	Symbols loaded.
 	xul.dll!mozilla::PresShell::ProcessReflowCommands(true) Line 9145	C++	Symbols loaded.
 	xul.dll!mozilla::PresShell::DoFlushPendingNotifications({...}) Line 4265	C++	Symbols loaded.
 	xul.dll!nsIPresShell::FlushPendingNotifications({...}) Line 585	C++	Symbols loaded.
 	xul.dll!nsRefreshDriver::Tick(1517246255796691, {...}) Line 1923	C++	Symbols loaded.
 	xul.dll!mozilla::RefreshDriverTimer::TickDriver(0x000001c69d219000, 1517246255796691, {...}) Line 337	C++	Symbols loaded.
 	xul.dll!mozilla::RefreshDriverTimer::TickRefreshDrivers(1517246255796691, {...}, {...}) Line 308	C++	Symbols loaded.
 	xul.dll!mozilla::RefreshDriverTimer::Tick(1517246255796691, {...}) Line 330	C++	Symbols loaded.
 	xul.dll!mozilla::VsyncRefreshDriverTimer::RunRefreshDrivers({...}) Line 770	C++	Symbols loaded.
 	xul.dll!mozilla::VsyncRefreshDriverTimer::RefreshDriverVsyncObserver::TickRefreshDriver({...}) Line 685	C++	Symbols loaded.
 	xul.dll!mozilla::VsyncRefreshDriverTimer::RefreshDriverVsyncObserver::NotifyVsync({...}) Line 586	C++	Symbols loaded.
 	xul.dll!mozilla::layout::VsyncChild::RecvNotify({...}) Line 70	C++	Symbols loaded.
 	xul.dll!mozilla::layout::PVsyncChild::OnMessageReceived({...}) Line 155	C++	Symbols loaded.
 	xul.dll!mozilla::ipc::PBackgroundChild::OnMessageReceived({...}) Line 1812	C++	Symbols loaded.
 	xul.dll!mozilla::ipc::MessageChannel::DispatchAsyncMessage({...}) Line 2110	C++	Symbols loaded.
 	xul.dll!mozilla::ipc::MessageChannel::DispatchMessageW({...}) Line 2042	C++	Symbols loaded.
 	xul.dll!mozilla::ipc::MessageChannel::RunMessage({...}) Line 1887	C++	Symbols loaded.
 	xul.dll!mozilla::ipc::MessageChannel::MessageTask::Run() Line 1920	C++	Symbols loaded.
 	xul.dll!nsThread::ProcessNextEvent(false, 0x000000aef6bfef82) Line 1041	C++	Symbols loaded.
 	xul.dll!NS_ProcessNextEvent(0x000001c6951061f0, false) Line 517	C++	Symbols loaded.
 	xul.dll!mozilla::ipc::MessagePump::Run(0x000000aef6bff4f0) Line 97	C++	Symbols loaded.
 	xul.dll!mozilla::ipc::MessagePumpForChildProcess::Run(0x000000aef6bff4f0) Line 302	C++	Symbols loaded.
 	xul.dll!MessageLoop::RunInternal() Line 327	C++	Symbols loaded.
 	xul.dll!MessageLoop::RunHandler() Line 320	C++	Symbols loaded.
 	xul.dll!MessageLoop::Run() Line 300	C++	Symbols loaded.
 	xul.dll!nsBaseAppShell::Run() Line 159	C++	Symbols loaded.
 	xul.dll!nsAppShell::Run() Line 344	C++	Symbols loaded.
 	xul.dll!XRE_RunAppShell() Line 873	C++	Symbols loaded.
 	xul.dll!mozilla::ipc::MessagePumpForChildProcess::Run(0x000000aef6bff4f0) Line 269	C++	Symbols loaded.
 	xul.dll!MessageLoop::RunInternal() Line 327	C++	Symbols loaded.
 	xul.dll!MessageLoop::RunHandler() Line 320	C++	Symbols loaded.
 	xul.dll!MessageLoop::Run() Line 300	C++	Symbols loaded.
 	xul.dll!XRE_InitChildProcess(15, 0x000001c695104020, 0x000000aef6bff6a0) Line 703	C++	Symbols loaded.


The second channel shows:

2018-01-29 17:02:34.716000 UTC - [16152:Main Thread]: D/nsHttp nsHttpChannel::MaybeRaceCacheWithNetwork [this=0000021BA1236000, delay=186]
2018-01-29 17:02:34.716000 UTC - [16152:Main Thread]: D/nsHttp nsHttpChannel::TriggerNetworkWithDelay [this=0000021BA1236000, delay=186]

In my local testing the second channel goes from the cache (concurrent shared entry).  There is apparently a race - when the first load doesn't make it in time, we refetch from network.  This is expected presuming the current (disabled!) preload implementation is incomplete.

I think this is simply a duplicate for the renaming work needed in bug 1394778/related.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.