No Code Attached Yet J4 Media Manager
avatar sanek4life
sanek4life
1 Aug 2020

Is your feature request related to a problem? Please describe.

When you enter the Media manager in the Сontrol Panel, and there you see 1000 images in a folder, the site page takes a very long time to load.

Describe the solution you'd like

I suggest to automatically add tag loading="lazy" to every image that is shown in the Media manager in the Control Panel.

изображение

Additional context

I've seen this already done as a frontend plugin and it works great. I suggest doing the same for the Control Panel (Media).

On my site, which is now on Joomla 3.9, there are folders in which there are 1000 images and when I go to these folders, the site page loads for a very, very long time, sometimes even the browser freezes.

avatar sanek4life sanek4life - open - 1 Aug 2020
avatar joomla-cms-bot joomla-cms-bot - change - 1 Aug 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 Aug 2020
avatar sanek4life sanek4life - change - 1 Aug 2020
The description was changed
avatar sanek4life sanek4life - edited - 1 Aug 2020
avatar PhilETaylor
PhilETaylor - comment - 1 Aug 2020

lazy loading is not the magic solution to a design mistake.

When you enter the Media manager in the Сontrol Panel, and there you see 1000 images in a folder, the site page takes a very long time to load.

There is simply no point in loading 1000 (eg: All images in the folder) images at a time - that is the root performance problem here that should be addressed with pagination.

Even if lazy loading of the images happened - there would still be 1000 html img tags in the source, driving up page size and load time of an Ajax request

avatar sanek4life
sanek4life - comment - 1 Aug 2020

lazy loading is not the magic solution to a design mistake.

When you enter the Media manager in the Сontrol Panel, and there you see 1000 images in a folder, the site page takes a very long time to load.

There is simply no point in loading 1000 (eg: All images in the folder) images at a time - that is the root performance problem here that should be addressed with pagination.

you don't even understand what the people who have a news site are doing. Joomla is not WordPress and if you constantly create new news on the site and upload images using drag and drop from the desktop to the article, then the folder with images can easily contain more than 1000 images if 1000 news were added to the site.

there are no 1000 images on any page of my site (frontend), I understand that it is too much for one page of the site.

but we're not talking about the frontend !!! we are talking about backend, about a folder where all images are automatically added (Control Panel - Media), which the editor drags from his work computer into the article. do you understand that?

have you ever made a news site? do you understand what it is? I do not have time for each news to create a new folder for the image to the news, I just drag the image from the desktop and then publish the news on the site.

Even if lazy loading of the images happened - there would still be 1000 html img tags in the source, driving up page size and load time of an Ajax request

Believe it or not, this tag really helped me very well (when I installed the backport plugin for Joomla 3) and now all the pages of the site load for users much faster and in the Google speed test my pages also load faster.

But we're not talking about the front-end. Sometimes I still go to the backend and when I open a folder with images, it takes a very, very long time to load and I'm not the only one who drags images into the article from the desktop. New folders are not automatically created for images when you constantly drag and drop them from the desktop and create new news on the site (perhaps in other CMS this is so, but not in @joomla).

avatar brianteeman
brianteeman - comment - 1 Aug 2020

You misunderstood what @PhilETaylor was saying. He is referring to the media manager trying to load all the photos in a folder in one go. He is stating that this is an architecture problem that should be fixed with having some pagination. Just as you dont list all 10,000 articles in article manager he is saying that you should do the same in media manager.

Personally I use one of the very many extensions available that will let me automatically store uploaded images either by data (like wp) or by user.

avatar sanek4life
sanek4life - comment - 1 Aug 2020

You misunderstood what @PhilETaylor was saying. He is referring to the media manager trying to load all the photos in a folder in one go. He is stating that this is an architecture problem that should be fixed with having some pagination. Just as you dont list all 10,000 articles in article manager he is saying that you should do the same in media manager.

Personally I use one of the very many extensions available that will let me automatically store uploaded images either by data (like wp) or by user.

This is the problem, even you have to use a third party extension.

I have done several thousand articles over the years and have added about 1 or 2 images to each article. Naturally, I did not upload these images via FTP or Media manager (this is very inconvenient). I just created a new article and drag and drop the image for the article from my desktop of my computer. This way I have a couple of thousand images in one folder, because all the images from my computer's desktop have been automatically downloaded to the same folder over the years.

I guess I am not the only one who uses @joomla and have this problem. I didn't upload 1000 images in one go, but this has happened over many years and several thousand articles.

To be honest, I never thought that at one point it would become a big problem to open the Media manager in the Control Panel, because it is not normal when absolutely all images in the browser that are in this folder are loaded immediately, although in at the top of the list I only see a few images and thousands of images are being loaded. A logical solution would be to add this attribute loading="lazy" to all images that the administrator opens in the Media manager in the Control Panel. Don't even need a plugin for that, just add a few new lines of code to CMS admin files, right?

avatar sanek4life
sanek4life - comment - 1 Aug 2020

@brianteeman plugin Content - Lazy Loading Images, which was made officially for @joomla, helped me a lot. now almost all pages on my site are glowing green for @google, because there are categories on my site where 50 or 100 articles are published on one page and each article has 1 image. this plugin really helped very well with my site's loading speed. if earlier 50 images were immediately loaded on the page, now only the first 3-4 images are loaded when entering the page. it's fantastic!
изображение

and now I think that this attribute loading="lazy" can also help very well to comfortable view images in a Media manager (Control Panel).

avatar ReLater
ReLater - comment - 1 Aug 2020
  1. All images are background-images. loading attribute only works with <img> tags. Therefore not a solution at all for this issue.

<div class="image-cropped" style="background-image: url(&quot;https://j4.illovo.de/images/dumm-wie-kruppstahl_2014.jpg&quot;);"></div>

  1. and just by the way: Why isn't there an un-minified mediamanager.js in Joomla 4. It's hard to debug mediamanager.min.js (and override). I will open a seperate issue for that.
avatar ReLater
ReLater - comment - 1 Aug 2020

and now I think that this attribute loading="lazy" can also help very well to comfortable view images in a Media manager (Control Panel).

No. Read my last comment, please.

avatar ReLater
ReLater - comment - 1 Aug 2020

If I would be a more clever JS developer I would think about an loading on(scroll..) solution or something. I'm sometimes happy to be stupid... ;-)

avatar brianteeman
brianteeman - comment - 1 Aug 2020

This is the problem, even you have to use a third party extension.

That's the entire point of joomla. Specific needs are catered for by extensions

avatar PhilETaylor
PhilETaylor - comment - 1 Aug 2020

you don't even understand what the people who have a news site are doing

Im sorry - you are wrong. I know EXACTLY what people with a new site are doing. I know EXACTLY what this problem is... here is one of the sites I look after

Screenshot 2020-08-01 at 18 49 00

Here is another

Screenshot 2020-08-01 at 18 59 00

Both these sites have considerably more than 1000 images in a folder.

have you ever made a news site?

Yes - see above.

do you understand what it is?

Yes - see above.

go to the backend and when I open a folder with images, it takes a very, very long time to load

Yes, for a start it has to download and parse and then render the HTML for all the images - lazy loading or not - the HTML DOM is still downloaded FIRST even if the image content is lazy loaded.

Without lazy loading, the page size ITSELF can be considerable - using the stats above, several Gb in size for a single page load!

I'm not saying lazy loading will not help, Im saying its not the correct solution to the architectural problem of loading all 1091736 images (or more specifically 1091736 div tags with styles having backgorund images, in HTML, in the document.

To be honest, I never thought that at one point it would become a big problem to open the Media manager in the Control Panel, because it is not normal when absolutely all images in the browser that are in this folder are loaded immediately,

That was the point I was making. I was agreeing with you. Its not normal to load ALL of ANYTHING anywhere. Pagination and Search should be used for any "thing" that otherwise could create unlimited amount of entries. We do this with Articles, Tags, Users, Dropdown select boxes.

Where we disagree is that you think LL is a solution. Its not. Its a sticky plaster over a decapitated limb.

Lazy loading only masks part of the problem and will only mask the problem up until a finite point. 1000 images is a low number

Lazy loading is NOT pagination.

Pagination and/or search should be employed on ANY entity that has an infinite number of items.

avatar sanek4life
sanek4life - comment - 1 Aug 2020

This is the problem, even you have to use a third party extension.

That's the entire point of joomla. Specific needs are catered for by extensions

I understand this, but still, everything related to working with articles (com_content), I think, can be developed within the framework of the @joomla kernel. it's not an online store or slider, gallery, forum or something like that. this is the same basic functionality for adding articles to the site.

to be honest, it would be a good rule to continue to develop a tool for adding articles to the site (articles, categories, tags, media manager). and leave the rest to the developers of third-party extensions. that would be a really good position for the CMS.

even for example such things as user registration (com_users) could be done by a third-party component and the same can be said about the component for contacts (com_contact) and banners (com_banners).

but the main thing is that everything related to articles (com_content, com_categories & com_media) should be developed within the framework of the main version of the CMS.

avatar PhilETaylor
PhilETaylor - comment - 1 Aug 2020

No one is disagreeing with you here.

avatar sanek4life
sanek4life - comment - 1 Aug 2020

Lazy loading is NOT pagination.

изображение
That would also be a good solution, I didn’t say I’m against pagination. I am looking for a way so that all 1000 images are not loaded in one go.

It could be pagination + image search string (so as not to go to page 150). This would be a good solution.

And the last thing - I am not a developer, I am a Joomla user. If I were a developer, then I could make my own CMS. I hope you understand this ??

avatar sanek4life
sanek4life - comment - 1 Aug 2020

When I created this theme, I didn't know that it was impossible to add attribute loading="lazy" for images in the Media manager (Control Panel). But in any case, we must find a solution for this problem, when 1000 images are loaded at once on one page.

It could be pagination or something else. One way or another, but this is already provided in @joomla, if you publish all the articles as a list (or as blog) - then there is a pagination so as not to show 1000 articles on one page. Something similar could be done for images in the Media manager (plus an image search string).

avatar brianteeman
brianteeman - comment - 20 Dec 2020

As stated before - there are solutions available. You just chose not to use them.

avatar Quy Quy - change - 4 Jan 2022
Labels Added: No Code Attached Yet J4 Media Manager
Removed: ?
avatar Quy Quy - labeled - 4 Jan 2022
avatar Quy
Quy - comment - 4 Jan 2022

Please test #36550

avatar alikon alikon - change - 5 Jan 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-01-05 07:39:26
Closed_By alikon
avatar alikon alikon - close - 5 Jan 2022

Add a Comment

Login with GitHub to post a comment