Skip to content
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

[Question]In browser console, why request resource which is marked 'preload' in the html won't work? #2853

Closed
NE-SmallTown opened this issue Jul 21, 2017 · 5 comments

Comments

@NE-SmallTown
Copy link

NE-SmallTown commented Jul 21, 2017

e.g. I use

<link rel="preload" href="http://foo.com/bar.jpg" as="image">

and

console.log(
  '%c   ',
  `
    font-size: 60px; 
    background-image:url('http://foo.com/bar.jpg'); 
    background-repeat: no-repeat; 
    background-size: contain;
   `
);

But will get warning 'The resourcehttp://foo.com/bar.jpg was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing.'

I think the request fired by console is also should be applicable to the 'preload' mechanism.If i am wrong, please let me know, thanks :)

@domenic
Copy link
Member

domenic commented Jul 21, 2017

I don't think this is the best forum for this question; I'd suggest e.g. StackOverflow.com, or the bug trackers of whatever browser you are experiencing this warning in.

Going to close, since this is not an issue with the HTML Standard, but happy to continue discussing in the closed thread---although again, I doubt we can be of much help compared to those other sources.

@domenic domenic closed this as completed Jul 21, 2017
@NE-SmallTown
Copy link
Author

NE-SmallTown commented Jul 22, 2017

@domenic Sorry.The reason I file this issue is that the spec just says

the user agent must preemptively fetch and cache the specified resource

but don't describe how to use it, so I don't know the situation I describe above whether is applicable for the 'preload' spec, and I am not sure this belongs to spec or browser(although I did not found the spec says the user agent should fire or not relevant warning), so I want to figure out first and then file the issue in the right place.

And maybe StackOverflow needs a long time to see a reply or even no reply about this, hah, so maybe closed thread is a good place to discuss?

@domenic
Copy link
Member

domenic commented Jul 26, 2017

The processing model for preload is described in the preload specification: https://w3c.github.io/preload/

But the processing model for consoles is browser-specific, and isn't defined by any spec since it's not observable by web pages.

@NE-SmallTown
Copy link
Author

got it, thank you :)

@NE-SmallTown
Copy link
Author

I file a related issue in chrome, if anyone want to know more about this, you can view this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants