-
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
Feature Request: Skip / Speedup Image Generation Processes #24822
Comments
This would be so nice. It takes 4-5 minutes to start the our dev environment when someone first gets started, or a dependancy is updated, or something get's messed up with the cache and |
Removing |
Is the main issue with When I was in China, it was an issue as downloading images from a remote resource outside of China was at very slow speeds for some reason and would sometimes drop connection corrupting images. I think I used Docker to work around that and just mount the image cache or something like that, which let me preserve that which took 10-30 minutes otherwise to handle. |
a) preserve cache
preserving image cache maybe would help, but if something is out of sync then this helps not so much b) skip expensive process
it is more like this, when you are working on components etc. where is no need to have optimized images. maybe in a later step when you have QA stage before going in production then the optimized images would needed |
BTW: i can not find the issue with the description of the change of api (jobs api?) to allow "outsource" the image processing into different services... |
This would also be super useful for CI pipelines, where generating image thumbnails is often wasted work. |
One approach might be to create a Gatsby source plugin that returns fake image data when a flag is set. |
suggest an API for some jobs/image processing, because this have more benefits and not only for some plugins: then this can used to have for expensive processes:
can services can changed with settings and no need to touch code |
This a major problem for one project I'm working on. Every time I add or update an unrelated NPM package Gatsby blows away the image cache and I can't work for 2 hours (yes, literally, and on an 8 core i9 CPU) while it regenerates 80k image thumbnails. It's brutal. Our Gatsby Cloud builds can do it in about ~45 minutes by comparison. For this use case, I can think of two approaches to mitigate this:
|
There was work about a year or so ago on having Images are cached based on parameters for processing the image with afaik, so if that hasn't changed, retaining the cached images probably would be fine. One other solution would be to have a separate process/service handle the image processing that gatsby communicates to, then it can just provide the output that gatsby needs and copy the images over without having to pointlessly reprocess. Especially sounds worthwhile to separate for a project with that amount of images and processing time. |
|
Speeding up image processing isn't the same as skipping image processing. The former is likely still going to cost you money for CPU cycles etc. One thing I've found that works pretty well is to move images to an S3 bucket, using @robinmetral/gatsby-source-s3 to source images via GraphQL at build time, and then use an env flag in |
here are questions about
|
also this blog post is linked in the netlify post: https://dev.to/biilmann/open-source-parallel-processing-for-gatsby-270d yes - that was that what i mean with
maybe it is possible to have a |
This would be great, working with an image heavy site whenever the cache gets cleared it means 30 minutes or more of hanging out and waiting for it to complete. a fake runner would be great as an option here. I actually was trying to get parallel runner to work for develop, even if it means a couple cents in cloud costs to have google functions make the images, that would be preferable to waiting most of the time. |
This would be very very helpful. When working on a large image-heavy site, most of the time I am working on stuff not related to images. But because of the build times where most of the time is spend generating images, the whole process is slowed down and it becomes harder and harder to work and test things in short cycles. Being able to set a flag for gatsby to skip all image processing and just return linked images as is would be epic. |
Looks like I created a duplicate here - #25827 There's a bunch of options I considered for a project I work on. I think there's two ideas that are worth pointing out:
It could look something like this:
|
@josephmarkus good ideas |
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! 💪💜 |
Generating image thumbnails is still the biggest pain for images with a lot of sites. 30 minute builds are becoming the new "my code is compiling" excuse for us developers to go get coffee. It defeats the purpose of the rapid iteration build previews that jam stack sites are known for. |
Please make this happen. It is really painful to wait for 20-30 min to generate image thumbnails. In my case the generating images is bloated because of the Fluid images. I resolved this by passing one break point to my graphql query where bigger images where not required. Maybe I should use a fixed image here:
Also as I am using
This reduced my images being generated from 2400 to 1400 which is better. I am wondering if I can ditch the |
Would give anything to have relative images in markdown without all the cruft that comes along with gatsby-remark-images. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
not stale. please make this happen 😕 |
Please keep this issue open. I would really like to be able to skip the image processing step when developing. |
I've been using a clumsy workaround by disabling It reminds me what developing Gatsby sites used to feel like haha. |
@muescha Skipping unnecessary work is a great idea! However, it would be cool if the thumbnail data could still be visible on the page. Eg. generate thumbnail once per image content, and retain this cache (similar to Conditional Page Builds (the Would you be open to changing the request to make builds for images incremental? So if there is a change to an image, it will be built once, but all historical image builds will be cached? I think this is a problem with the approach of image processing in Gatsby actually (eg. the Gatsby mantra of "just reprocess, all the time" and "parallelize the work if it's a lot of work" - see thread of tweet below). In my opinion, a single image should never be rebuilt, so long as the content never changes. |
We're currently working on this, I'm closing this one in favor of this discussion |
Hey everyone! Good news: we've shipped this in There's also an updated discussion link: Quoting the release announcement below:
|
Summary
i would like to skip the step of creating image thumbnails and create "fake" thumbnails.
Basic example
i set some option to skip the thumbnail creation / image processing
it creates "Fake" imagesets, and i can query all sharp image options from GraphQL, but it always return the original image without changes
i don't remember if there was planned an api for different image manipulation providers (image sharp, external services, lambda functions, gatsby cloud) - but then it can set up with a fake image service...
Motivation
gatsby develop
command in the gatsby doc site.gatsby clean
and the thumbnails are not cached anymore and it needs recreatedTimes:
about 36min :(
The text was updated successfully, but these errors were encountered: