-
-
Notifications
You must be signed in to change notification settings - Fork 677
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
Bring back load_delay ? #474
Comments
Hey @Tenchi2xh, I get your point and I'll think about reintroducing When I firstly introduced The recently introduced So when I introduced the Now if you ask me, you're probably taking the wrong approach to solve the problem. You're trying to protect your server by limiting the number of requests it receives, but what if your website audience increases and your server gets the double, or triple of visitors at a given time? You would get the same problem again. And increasing the In my opinion, the correct approach to solve your problem would be to make your server scale, by either:
There are also commercial alternatives to generate images on the server side, like Cloudinary and Akamai Image and Video Manager, that probably solve the same problem you're trying to solve, but in a more flexible and scalable way. Please let me know what you think. |
Oh, it's for an internal app that will be used by at most 5 or 6 people in a small company. The server in question rendering images is Grafana while using the feature to render statistics panels, and that app isn't scalable. As for detecting the canceled requests or other solutions I would need to make my own fork and host it myself (we use a SAAS). I would totally agree with your solutions if I was building a real user-facing product 🙂 And since it is only an internal app, all 6 of us really don't mind at all waiting 200ms to avoid crashing our statistics server haha Thanks for the thoughtful answer! |
You’re welcome. In that case, I think you’re pretty good using version 15.2.0 of vanilla-lazyload. Don’t feel bad being updated to an older version, it doesn’t have any bugs, it’s fast and it does exactly what you need. The reason is that reintroducing |
True ! I will then close the issue |
Hey @Tenchi2xh, If you’re happy with my support, the documentation and the effort I’ve been putting on this project in the latest years, you might want to buy me a coffee to show your appreciation. Open-source software is great for everyone, but it takes passion and time (and conversations like this) to grow and evolve. Thank you for considering it. |
Hey verlok, I would love to reopen this issue with a real world example. In my company we are using highly generated pages with lots of picture tags which all include about 5 to 8 resolutions for different devices. Then also we have a newsletter which is sent do above 1 million users. In this newsletter there are links to some of our sites. Most of them referring to one topic on that pages, navigated by a anchor. I was remembering an options to delay the loading and I want to try it, but as it seems you have removed it. Does this makes sense to you? |
Hey @hummal You can try with LazyLoad 15.2.0, which have the Anyway I do think that...
...given you are not able to preset images heights, due to responsiveness, it's a bad idea to make the links point to an anchor down below. Even if the blazing-fast-scroll-down works and the anchor position is maintained, when the users scroll up they would see the website moving down. So if I was you I would rather consider removing the anchor, or putting what you're pointing to with the anchor in a specific landing page. Let me know what you think. |
Hey @verlok, thanks for you reply. load_delay has some positive impacts on the result but did not solve it entirely. This is due to reloading styles from elements not in visible areas. So I guess you can leave it as it is. Iam sure that anchor urls are a big topic in enterprise environments. In my case it is not an option to remove an anchor from that pages because it is crucial to guide the customer to the information he is searching for. Also it is already a landing page. But this doesn't seem to be a topic for your library. Thanks or hearing me. |
Hey again @hummal the right approach there is to occupy vertical space before the images are loaded by LazyLoad. So when they get loaded, they don’t move the page up or down, avoiding to mess with your anchors. Doing that will also optimize the CLS core web vital. Up to you to find a way to deal with the fact that the height of your images might vary due to responsive images with the picture tag. 😅 If you’re happy with my support, the documentation and the effort I’ve been putting on this project in the latest years, I hope you might want to buy me a coffee to show your appreciation. Open-source software is great for everyone, but it takes passion and time to grow and evolve. Thank you for thinking about it. |
Hey there, nice library, thanks for all the work 😄
I have a particular use case where I have a page full of images, but each image is generated server side. When the URL for an image is loaded, the server creates a docker container, does some pretty heavy stuff, and returns a computed image.
To prevent the server from crashing, I need some lazy loading to avoid loading the whole page at once, but also some protection against very fast scrolls that will trigger lots of image renders.
While searching for a way to prevent that in the issues of this project, I found that there used to be a
load_delay
option that only starts loading an image after it's been on the viewport for a certain amount of time, and that's exactly what I need (#235, #166)The release notes say:
But in this case, that's not actually true, because using the feature that replaced
load_delay
,cancel_on_exit
, will still trigger a bunch of render requests, promptly cancelling them, ignoring the responses because they are cancelled, all of that leading my server still exploding 💥So I'd argue that
load_delay
andcancel_on_exit
are only equivalent from a client's point of view, but totally different server side, so they are different features 😅For now I am going to use an older version, but it doesn't feel nice to be behind on fixes and improvements.
The text was updated successfully, but these errors were encountered: