Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

263
Visualizações
Load image before anything else (render-blocking)

I have an image i want to load as the first thing when my page loads. Currently i have an img tag with a src but it loads asynchronously, how can i assure the browser loads my image before rendering the page further?

about 4 years ago · Santiago Gelvez
2 Respostas
Responde à pergunta

0

A simple solution could be to use the preload attribute on <link>: Link types: preload. It is not a grantee that the content will be ready, as I read it, but maybe it fits your case.

Here is an example:

<head>
  <link rel="preload" href="https://via.placeholder.com/450" as="image"/>
</head>

<body>
  <img src="https://via.placeholder.com/450" />
</body>

about 4 years ago · Santiago Gelvez Relatório

0

I have done something similare ...

I have a 'splash screen' (you can use a simple white div to simulate no rendering ...) Make a fetch to the img in js, then remove your splash screen ...

Fetch the img in js load the img in browser cache... so when your DOM display the img, she already in the browser cache ...

about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda