Skip to content

Explore performance improvements (with icon helper) #69

@igorkasyanchuk

Description

@igorkasyanchuk

First of all, I really like the gem, and I use it and recommend it.

I want to share an interesting observation, I have a page and I have maybe lets say 100-500 icons on edit (edit, delete, etc).
And I decided to work on improvements how to make page load faster.
One of the unexpected observations is that poor page performance was because of the icons embedded into HTML page.

So, when I did this (moved some of the icons to CSS)

.ellipsis-vertical-icon {
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZT0iY3VycmVudENvbG9yIiBjbGFzcz0ic2l6ZS02Ij4KICA8cGF0aCBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik0xMiA2Ljc1YS43NS43NSAwIDEgMSAwLTEuNS43NS43NSAwIDAgMSAwIDEuNVpNMTIgMTIuNzVhLjc1Ljc1IDAgMSAxIDAtMS41Ljc1Ljc1IDAgMCAxIDAgMS41Wk0xMiAxOC43NWEuNzUuNzUgMCAxIDEgMC0xLjUuNzUuNzUgMCAwIDEgMCAxLjVaIiAvPgo8L3N2Zz4K");
background-size: cover;
background-repeat: no-repeat;
}

I got maybe 20-30% page speed improvement.

So I want to share an idea for the feature. What if we can automate this CSS generation, based on some yaml, it will create CSS for all icons or specific.

PS: maybe I'll try to find time to implement it, if it makes sense. It can actually also be a standalone gem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions