-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to disable downloading of images when using the gatsby-source-shopify
plugin.
#23724
Comments
Thank you for opening this! Can you give us some more information on your issue? You should already be able to not use sharp by not querying Moreover, you could also So I'm not sure if it's necessary to add another option to this specific plugin. |
Hi @LekoArts, You're quite right that not referencing |
Ah, gotcha. So it would make sense to include that option then. |
Sorry if I wasn't clear enough the first time 😊 |
Yeah from how @lukebennett88 description to me privately if you've got 500+ products with 5 images on each products then that's 2500 images to download them if you try to use them it will then do all the required transformations. This is huge unneeded downloads, storage and processing when Shopify provides a CDN. The Gatsby-source-sanity plugin I noticed uses the sanity CDN (or optionally cloudinary) Hope that helps. @lukebennett88 and I would loved to help make an attempt at a pr to achieve. But certainly open to help. |
I've got a crude implimentation, open to whoever is best / familiar with the plugin but I have had one pair sesh a long time ago with @pieh which I enjoyed. regards |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
@lukebennett88 as the creator are you able to tag this as not stale? we have a PR addressing this issue and some community support. please let the bots know this issue isn't stale. @beamercola and @Haven3 ?? regards |
Looks like I can @mrhut10. just removed it. |
Looks like you need to yeah tag "not stale" to prevent it automatically being closed by there bots |
Gosh do we need this! I've been running a local fork of |
@GooBall I would love to see your implementation incase yours is better than mine? otherwise, keep up the conversation hopefully will get reviewed by a core team soon. |
we are getting close to having this feature merged in, are you still using the shopify sdk? |
@mrhut10 I am still using the sdk in production with my fix to disable the image download. I actually did an implementation to return the shopify cdn image urls through the gatsby-source-shopify plugin. It worked great and there was a big improvement to site performance (by not having to go through the sdk for images). But when I deployed it to the production site we ran into cache issues where products had the wrong image showing. I'm not convinced the issue was to do with my implementation and more to do with how the products were mapped over. However, I simply haven't had enough time to revisit it yet. Congrats on getting the PR merged! |
@GooBall is your implementation still up on your github? I'd loved to have a look if your open to it. as would be a killer feature to have, and I'd be interested to see if could reproduce the image cache problem you might have had. did you write a custom resolver so that you could specify what size image you want in the graphQL query itself to get from shopify? |
Summary
I'm working on rebuilding an existing Shopify site as a Gatsby site using the
gatsby-source-shopify
plugin. It has ~600x items, and my internet connection isn't particularly good, so it can take a very long time for the site the build (even in develop mode). Sometimes the build will fail completely. If sharp tries to transform any of the images it takes even longer and is even less stable.I think it might be a good idea to add an option to disable downloading the images, as we can still serve the images from Shopify's CDN. The Shopify CDN will let you resize images using the URL, so the performance is still pretty good. Here is a page with some info on doing this: https://www.shopify.com/partners/blog/img-url-filter
Basic example
Motivation
Adding this option will make it much easier for people to use this plugin if they have poor internet connections, less powerful computers, or are using it to connect to a store with a large number of images to download.
I plan to attempt to add this myself (along with the help of my friend @mrhut10), but I've never written/worked on a Gatsby plugin before, and have limited knowledge of GraphQL outside of using it within Gatsby.
I also wanted to make sure it sounded like a good idea first, and that I'm not overlooking anything before doing the work and submitting a PR only to have it rejected.
If this goes well, I want to also work on a companion plugin to use the images from the Shopify CDN in
gatsby-image
in much the same way asgatsby-transformer-cloudinary
I'm not sure if this is possible since we need a base64 image as well, but I'll open a seperate issue for that once I get some feedback on this issue.
The text was updated successfully, but these errors were encountered: