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
Optimise how SVGs are rendered in the control panel #7146
Comments
Where exactly? Asset thumbnails use |
On the entry edit page (Something like https://example.com/admin/entries/pages/3, for example). That's my point - using |
Ah gotcha, I thought you meant the opposite. Including the SVGs in the source directly would require us to start sanitizing them, which would add its own (server-side) performance hit. Maybe better if we just start saving SVG thumbnails as PNG files. |
That would probably solve the problem too. Would it require Imagick? |
@darylknight yeah, unfortunately, GD won't do that. |
No problem, I can deal with installing Imagick if I need to. Any idea if/when you'll add this? |
We can try to get this resolved for 3.6, one way or another. Any chance you can zip up all of the SVGs and send them over to support@craftcms.com so we have something to test with? |
Yep, sent! Thank you. |
Yes you're right - I should have mentioned that. We discovered that when we tried to use an inline svg instead of an img that the method we'd used (fill pattern) didn't display properly. Our designer had to re-do all the illustrations to work with the inline tag method on the front end. It would be best if the CMS didn't run into issues like that, so PNGs are probably the better option. |
We just added a new |
Perfect, thank you! |
Craft 3.6 has now been officially released ✨ |
Description
We're working on a site which has a lot more SVG illustrations than usual. Over time, the editing experience in Craft has got slower and slower, and it's now almost unusable. I've traced this to the site having SVGs - even with 10 on a page, the editor screen slows to a crawl; laggy scrolling, animations for opening/closing Preview and adding matrix blocks render at about 1 frame per second.
I -think- this is because the SVGs are being rendered as
<img>
tags rather than inline svg code. I can change that on the front end, but I can't affect the control panel. Would you consider changing the way SVGs are rendered in the control panel to improve this?Removing all the SVGS makes the control panel work at normal speed again.
References:
https://halfelf.org/2016/many-svgs/
http://craftsnippets.com/articles/working-with-svg-images-in-craft-cms-templates
The text was updated successfully, but these errors were encountered: