Skip to content
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

Media SVG autoload causes enormous pages #25

Open
Rahe opened this issue May 17, 2022 · 3 comments
Open

Media SVG autoload causes enormous pages #25

Rahe opened this issue May 17, 2022 · 3 comments

Comments

@Rahe
Copy link
Member

Rahe commented May 17, 2022

Hello,

By default the SVG files from the media library are included into the content body when picker is used.

On some sites, event if the files are not icons properly said, they are added and the Body weight more than 5Mo compressed and 18mo decompressed !
Without it, we are at 200kb max !

Quick soltun that come to my mind
Make the load from the media libray opt-in from the code.

Nicolas,

@Rahe
Copy link
Member Author

Rahe commented Nov 23, 2023

This is due to the evolution handling the uploaded medias.
Solution possible on display_svg method, ignore file type "media" because we use the URL and not the svg embeded.

			if ( ! is_file( $file['file'] ) || 'media' == $file['type'] ) {
				continue;
			}

Other solution is to always use the url with the # in front of the url for the sprites.
So there will be no other SVG embeding into the page.

To discuss.

@Rahe
Copy link
Member Author

Rahe commented Nov 24, 2023

First : Quick win with a patch for the HTML page size.

Second : More profound changes for the medias from the attachment pages (use of comment_count), ony use URLs

@ecorica ecorica pinned this issue Jan 30, 2024
@ecorica ecorica unpinned this issue Jan 30, 2024
@ecorica
Copy link
Contributor

ecorica commented Mar 11, 2024

The first part is in release 2.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants