5
rslonik
7y

I had this idea
convert my application icons into base64 and save everything in one big js object

one month after this bizarre moment now I'm here trying to develop a even worst approach.

any suggestions?

Comments
  • 1
    I use svg paths for icons...
  • 2
    The whathaveidone tag is 100% appropriate 😀
  • 0
    I did this in Yesod (Haskell web framework) for fun. All images/icons as minified svg in templates, then it would inline everything (css, minified js, svg, etc) at the last moment so you would have only a single request for the complete compiled html file.

    It makes loading pages by themselves very fast, but you don't have the advantage of shared cached items (icon was loaded on page a, so for page b it can be retrieved from browser cache)
  • 0
    If you are already using SVG anyway, you can embed multiple SVGs into one and reference them by their path.

    If you *have* to embed them in JSON, why do you base64-encode them? SVG is already a text format, which can be gzipped by the server.
    PNGs and JPEGs are embedded in SVG as base64 already, why would you double-base64-encode them?
    That sounds like a >100% increase in file size...
Add Comment