Closed ste7enm closed 4 years ago
Was thinking this exact thing.
This would reduce the overhead the plugin contributes to a pageload. Would be happy to donate to have this done.
Good call. I'd throw $20 at a PayPal.me for this 👍.
It seems like a good idea but it will need some thinking through. Potential stumbling blocks are:
I think the main contributor to page load is not the grabbing of the images (that happens once every couple of hours and can easily be offloaded without the user knowing - aiming to do this in #39), it is mostly likely that we are not making good use of the Instagram CDN. We cache the URLs that are closest to the server, not the visitor.
Interesting points. Anecdotally:
4-10 images shouldn't fill any media library - if it's purging the previous images and re-caching the most recent posts daily, there should never be more than 1-mb cached.
Checking for successfully cached images and falling-back to loading from IG should resolve this. eg. if_file_exists(images/wpiw_cache1.jpg){load_from_local}else{load_from_ig}
I couldn't comment on this aspect.
This is a very fringe case but good for you for considering. I can't image more than 1% of the installed base would encounter this.
The main issue with pagespeed becoming a concern is loading third-party content involves additional DNS lookups. Pulled from a live site:
That's 90ms/140ms spent establishing a connection. If it can be lazyloaded it's not so problematic (we typically see it installed at the bottom of the page) but if it's render-blocking then almost 100ms is significant.
Yeah, I'd imagine it having a dedicated folder (made writable, per 2, advanced users only) so that it didn't filter into and bog down the Media Library (1).
Agreed the strain that I'm observing is the actual loading of the images from Instagram's CDN. Seeing it on every page load hurts my optimization-obsessed heart.
Further to above, server side caching would help avoid Instagram "fixing" end points that cause image loading to fail: https://github.com/scottsweb/wp-instagram-widget/issues/100#issuecomment-409294920
It would reduce the number of hits to Instagram's endpoints, making it less of concern for them to "fix". Fly under the radar.
This project is being archived (background in #118). Instagram filed a trademark complaint which saw the plugin removed from WordPress.org and then proceeded to block it from accessing instagram.com. All issues are being closed and it will soon be in a read only state.
Damn shame, this was a really great one, @scottsweb. Good luck with your other projects and thank you, on behalf of the community, for your work on this one.
Thanks :)
Would love to see an option to scrape Instagram at X frequency, but then cache and host up the images locally, almost similar in a way to the way this Gravatar plug-in works.
Instagram is sometimes contributing to up to 4 seconds in my waterfall for only 5 images.