skip to Main Content

Currently, if I scroll down on my website parts of my image take time to load kind of ruining the immersion.

How can I make the browser pre-load (and not unload) the whole image or a specific part of the image when the page is open?

I know this is probably a performance hit but I’ll account for that.

Image takes time to load after scroll instead of being pre-loaded
Image takes time to load after scroll instead of being pre-loaded

2

Answers


  1. Use, disable lazy loading with PHP;

    add_filter( 'wp_lazy_loading_enabled', '__return_false' );
    
    Login or Signup to reply.
  2. You can use rel=preload to preload content like images.

    <head>
      <link rel="preload" href="https://via.placeholder.com/800x600"
        as="image" crossorigin />
    </head>
    <body>
      <h1>Image</h1>
      <img src="https://via.placeholder.com/800x600">
    </body>
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search