[GH-ISSUE #495] Base64 version (feature request) #302

Closed
opened 2026-03-03 14:37:22 +03:00 by kerem · 5 comments
Owner

Originally created by @lazysergey on GitHub (Oct 4, 2018).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/495

each flag generates separate request to the server

Originally created by @lazysergey on GitHub (Oct 4, 2018). Original GitHub issue: https://github.com/lipis/flag-icons/issues/495 each flag generates separate request to the server
kerem closed this issue 2026-03-03 14:37:22 +03:00
Author
Owner

@lazysergey commented on GitHub (Oct 4, 2018):

@lipis can you give a comment on this?

<!-- gh-comment-id:427105922 --> @lazysergey commented on GitHub (Oct 4, 2018): @lipis can you give a comment on this?
Author
Owner

@lipis commented on GitHub (Oct 4, 2018):

can you be more specific on what you need and how can we help?

<!-- gh-comment-id:427106138 --> @lipis commented on GitHub (Oct 4, 2018): can you be more specific on what you need and how can we help?
Author
Owner

@Findus23 commented on GitHub (Oct 4, 2018):

@lazysergey
I'd recommend you to setup HTTP 2.0 which makes the overhead of all those requests a bit less dramatic.

And keep in mind that putting all SVGs as base64 would mean that the browser have to wait with the css rendering until 3MB css have been loaded (even more as bas64 is larger than binary).

<!-- gh-comment-id:427108326 --> @Findus23 commented on GitHub (Oct 4, 2018): @lazysergey I'd recommend you to setup HTTP 2.0 which makes the overhead of all those requests a bit less dramatic. And keep in mind that putting all SVGs as base64 would mean that the browser have to wait with the css rendering until 3MB css have been loaded (even more as bas64 is larger than binary).
Author
Owner

@lazysergey commented on GitHub (Oct 4, 2018):

sure, I’m using your awesome lib in countries phonecodes dropdown. When I open the dropdown my app triggers 257 get requests for each *.svg flag
So I thought it might be good feature to have css where all SVGs are encoded directly in css via base64 so server will not be hit with hundreds extra get requests for the flags - it will get all of them along with css

<!-- gh-comment-id:427108396 --> @lazysergey commented on GitHub (Oct 4, 2018): sure, I’m using your awesome lib in countries phonecodes dropdown. When I open the dropdown my app triggers 257 get requests for each *.svg flag So I thought it might be good feature to have css where all SVGs are encoded directly in css via base64 so server will not be hit with hundreds extra get requests for the flags - it will get all of them along with css
Author
Owner

@Findus23 commented on GitHub (Oct 4, 2018):

One more thing: If the flags are shown really small (~20px) you could do something similar to what I am doing in Matomo: Convert the SVGs to optimized PNGs (with 3x resolution for high-res displays).
As flags compress incredibly well the files will have about 180 bytes(!) each with 64x48 px and maybe they will load and render faster in the browser.

<!-- gh-comment-id:427110031 --> @Findus23 commented on GitHub (Oct 4, 2018): One more thing: If the flags are shown really small (~20px) you could do something similar to what I am doing in Matomo: Convert the SVGs to optimized PNGs (with 3x resolution for high-res displays). As flags compress incredibly well the files will have about 180 bytes(!) each with 64x48 px and maybe they will load and render faster in the browser.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flag-icons#302
No description provided.