Questions tagged [lazy-loading]

For programming questions about "lazy loading", a design pattern that defers initialization of an object until the point at which it is needed.

Lazy loading is a commonly used in computer programming to defer initialization of an object until the point at which it is needed. It can contribute to efficiency in the program's operation if properly and appropriately used. The opposite of lazy loading is Eager Loading.

5918 questions
2
votes
2 answers

Why does PrimeNG VirtualScroller loadingItem not working?

I have PrimeNG 11.0.0-rc.2 working with Angular 11. Im using the VirtualScroller Component but I realize that the loadingItem ng-template which is supposed to show a loader statement is not working, not even in their example, they have…
turboaux
  • 21
  • 1
  • 3
2
votes
2 answers

How lazy load picture element in slick slider?

Ken Wheelers slick slider works great with normal pictures like jpeg. To improve loading performance i try to work with the picture element to have webp support with fallback. The data-lazy attribute works only with the img tag. Is there a solution…
harley81
  • 190
  • 2
  • 12
2
votes
2 answers

How to Lazy Load RabbitMQ queue using @Lazy in spring boot?

Actually in my RabbitMQ config I have declared 10 consumers for each queue. So all consumer threads are created before my Spring Boot application is fully up so it is taking time on application startup. I want to lazy load all my Rabbitmq queue when…
Nivi
  • 71
  • 5
2
votes
2 answers

Lazy load a module using React lazy?

Is it possible to load a heavy module using React.lazy? I have a very heavy raw file parsed as string (around 10 mb) and I would like to lazy load it. After trying: const Module = React.lazy(() => import("./heavyModule").then((heavyModule) => { …
Rashomon
  • 5,962
  • 4
  • 29
  • 67
2
votes
2 answers

Named Lazy import in React Workaround

I made a workaround for named Lazy imports in React I want someone to check if this is actually working as lazy import or not. Toast.js import { ToastContainer } from "react-toastify"; export default ToastContainer; App.js const ToastContainer =…
qasimmehdi
  • 337
  • 1
  • 5
  • 12
2
votes
0 answers

lazy loading on multiple embed vimeo video

I'm building a portfolio website that contains several embed Vimeo videos and they're slowing down the page loading a lot. So I was thinking of lazy load them so that the browser has to load them only when they actually appear in the page. I've…
baband
  • 123
  • 12
2
votes
1 answer

How to lazy load an image in CSS

.image--about { background: url(../img/ZIZF.gif) no-repeat center; background-size: cover } I have this CSS. I want to use lazy loading to following images that I load via CSS, can you please help me out?
2
votes
1 answer

Hibernate lazy loading requires EJB transaction?

When trying to optimize transactions on my java ee 6 project using hibernate, I tried to do as I did with Eclipselink and have transactions turned off for read-only queries, like…
Rasmus Franke
  • 4,434
  • 8
  • 45
  • 62
2
votes
1 answer

A generics problem whilst creating a lazy NavigationLink in SwiftUI

I noticed that when using NavigationLinks in SwiftUI, the destination views are loaded before they are presented, which causes an issue in my application. I used the answer here to solve this problem creating a NavigationLazyView as follows: struct…
Tyler Durden
  • 575
  • 7
  • 23
2
votes
3 answers

What's better? More HTTP requests = less data transfered or Less HTTP requests = more data transferred?

Sites like Facebook use "lazy" loading of js. When you would have to take in consideration that I have one server, with big traffic. I'm interested - which one is better? When I do more HTTP requests at once - slower loading of page (due to limit…
genesis
  • 50,477
  • 20
  • 96
  • 125
2
votes
0 answers

Vue 3 - Lazy load Image Component

With Vue3, I'm trying to create a Picture component with lazyload integrated to it. Everything works fine when I load the page and none of the Picture are in viewport (when I scroll down, the images are loaded successively). However when the page…
2
votes
1 answer

I need a way to load the children path as LazyLoad from dashboard (parent component) as LazyLoad only if the user routes to that link

I'm developping an angular application where i need most of the components to be Lazy Load, i've a dashboard component which is lazy load itself, in that dashboard I need other Lazy load component for example Component 1 Component 2 the code down…
Dayvid Kelly
  • 114
  • 12
2
votes
1 answer

JPA lazy loading of @ElementCollection

After reading several web pages I still do't understand why my @ElementCollection are loaded eagerly. My understanding is that any @ElementCollection shall always be loaded lazily by default. As you see, that is not the case - you'll see the console…
Alex
  • 1,387
  • 2
  • 9
  • 14
2
votes
1 answer

Vuex conditional (lazy-loading?) store

I'm building an SPA in Vue.js to manage documents and dashboard for logged users. I face the following problems: I have one vuex store with several modules, managing different things. One (some) of theses modules are for administration purpose (add…
vicovicovico
  • 358
  • 1
  • 4
  • 16
2
votes
2 answers

lazy load module inside main component in Angular 10

I got two modules in my application one is the app.module and another one is user.module which gets lazy-loaded. On the app.module I got a sign-in component, sign-up component and main component. The main.component is the component consisting of a…
surjendu_dey
  • 578
  • 2
  • 11
  • 28