• Resolved lyden

    (@lydenyardley)


    Hello,

    I’m getting value out of your plugin so far, but noticed an issue.

    Activating advanced mode and SVG inlining doesn’t prevent svg file loading in addition to the inline code in HTML. One of the main reasons for me to use this plugin, is to reduce the number of requests/resources from the server.

    My logo, and the two main images are all svgs on my homepage – https://yardley.me

    Can you advise?

    Cheers,
    Lyden

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Benbodhi

    (@benbodhi)

    Hi there,

    My plugin won’t reduce the requests as it actually uses your IMG tag to grab the same source file, like any image would… however, it’s at that point, my plugin works its magic and replaces the IMG tag entirely with the SVG code from the source file.

    So my plugin won’t reduce requests for you unfortunately.

    You could embed your SVG code in your page/post though, that will remove the request for a file since it’s just embedded there.

    Thread Starter lyden

    (@lydenyardley)

    Hi @benbodhi,

    Thanks for the response and explanation.

    Is there any way to build this into a feature of your plugin I wonder, because once your plugin (and the inline option) does its thing, the svg file is completely redundant?

    Sincerely,
    Lyden

    Plugin Author Benbodhi

    (@benbodhi)

    That’s certainly an interesting approach… It would have to be handled on the admin side while creating a post/page and the SVG code stored in the database.

    It’s pretty much the same as putting your SVG code directly in your post/page. You don’t need a plugin for that. Just open up your SVG file in a code editor like sublime text and copy the code to use in your site.

    Thread Starter lyden

    (@lydenyardley)

    Yeah, I know I could do that, but there are a couple of general issues with that approach:

    • The page editing experience becomes less intuitive due to seeing a block of svg code rather than the image until ‘preview’ is selected.
    • A user is unable to use the media admin to manage site images/illustrations – ok for me or those of us who are technical, but not so for your average user, editor or author

    Admittedly, I don’t know what would be involved to execute this idea into your plugin, but hopefully it’s food for thought? It would surely be beneficial for the internet as a whole not to be loading assets unnecessarily?

    Plugin Author Benbodhi

    (@benbodhi)

    I hear your point, but the file will need to be loaded wherever it is used like an image. Unless it is processed in the admin somehow first, but then it’s a different experience. I have definitely taken note, it could be something worth adding. Thank you for your suggestion ??

    Plugin Author Benbodhi

    (@benbodhi)

    I have added it to the list of things to implement… As I was typing it out, the concept became a bit clearer in terms of how to achieve the outcome of simple clean use like any image, but if user chooses to inline, then store the SVG code in database and render the code in page, but admin side shows simple image preview still. All for the purpose of reducing file requests when using inlined SVG code.

    Now the requirements are clear, the process is clear… just a matter of deciding how the best approach would work and how to implement that… and if it really is worth it.

    Thanks again for your suggestion. It could be a really cool thing for optimization.

    Thread Starter lyden

    (@lydenyardley)

    @benbodhi you’re very welcome, and thank you for taking the time to think it through and come back to me.

    If I can do anything to help, just let me know ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘SVG inlining doesn’t prevent svg file loading’ is closed to new replies.