• aiwetir

    (@aiwetir)


    I kinda lost track of how this all works after I finished developing my site and just used my website for a while. I notice that the srcset does not point to the CDN. I recall this was like this a few months ago, has anything changed or is there something I can do?

    https://ww.wp.xz.cn/plugins/dreamspeed-cdn/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I’ve not been able to figure a way to change srcsets properly :/

    The issue is simply this: I have to filter them ONLY when the image is actually uploaded to the CDN.

    Which would be kinda ‘easy’ except that wrapping that check around a filter for a gallery page is painful :/ Lots of images.

    Thread Starter aiwetir

    (@aiwetir)

    That would probably slow things down a good bit. I realize it’s not ideal (as people would have to redo all their posts), but what about some hook in the process where you check when the media is added to the gallery? Or maybe a checkbox on the post edit page that says “all images are in the CDN”?

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    There is actually a meta data setting for “This image is in the CDN”

    Doing the query on each one “Does this image have the setting? Yes? Okay change!” is not to terribly hard, it’s the damn resizes. I couldn’t find a single sane way to check “Is this RESIZED version on the CDN?” without actually checking for the image’s existence.

    For the majority of people, this is no problem. But if you ever change image sizes afterwards, or change themes (which can do that) or add a plugin (which … can do that…) then it breaks down.

    Thread Starter aiwetir

    (@aiwetir)

    Ah, yes of course. I was looking at writing a srcset filter where I could just str_replace. That’s probably not worth putting into your plugin though.

    Plugin Author Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Yeah, as much as I hate it, it’s making me rethink the entire plugin’s approach!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Srcset to CDN’ is closed to new replies.