[Support Guide] How can I optimize my Netlify build time?

Hi @fool sorry to bother you again.

Are you also able to switch off the continuous integration for these two sites?

  • 9817c7b9-1d9f-4f33-8aba-f998885bd9d9
  • 17e78315-c641-45aa-aacc-1c4f9f819b9d

Thanking you!

Sure. I’ve turned off automatic builds on those sites, @angslice . You can still build by pressing “trigger deploy” from the site’s deploy listing page (or by using incoming buildhook: https://docs.netlify.com/configure-builds/build-hooks/)

Hi @fool, it appears they are still deploying from Github and not unlinked. (Sorry if I was unclear)

Yes, I only turned off automatic builds as requested; you asked me to “switch off continuous integration”, not “unlink the repo”. You can still build with webhooks and if you press “Trigger deploy”, but I can see no builds have happened since I set the setting, so not sure what you mean by “they are still deploying” since there have been no deploys since we last spoke?

If you want the repos unlinked entirely, happy to do that instead, just let me know.

1 Like

Hi @fool,

Sorry totally my mistake.
Yes, if you could unlink them that would be awesome! :smiley:


Good morning @fool,

Did you have any luck with unlinking these sites?

  • 9817c7b9-1d9f-4f33-8aba-f998885bd9d9
  • 17e78315-c641-45aa-aacc-1c4f9f819b9d

Sorry my developers are chasing after me on this.

Thanking you :smiley:

these are unlinked now, @angslice!

1 Like

I have the same issue as @nicolasrouanne, the command works locally (macOS) but not when run on Netlify in the build step.

Hey @kmiyashiro,

What error are you getting? Have you tried the .sh script as advised? What did this show/tell?

Could you please unlink:

  • cdfef0c1-d55d-4c75-8e1a-13eb1a2e983c (phoenix-slipstream)

Hi, @PHOENiX. Done! :+1:

Hello. I would appreciate it if you would unlink:

  • fbceb7f7-7e90-4116-9d0b-107bdcfecfe9

Thanks! Please email or message me if you need additional details, verification, etc.

No problem @brycewray, just got it unhooked for you.

1 Like

Hi there. Reading this thread with interest. My use case is that I have active editors (people) on a CMS like Forestry.io. Imagine that they log in and edit ten documents in series, over 10 minutes. In this case I wish to avoid building the site ten times in ten minutes.

Is there a way to ask Netlify to not build a commit until X minutes have passed since the last commit?

The way this would work would be like a tape-delay on Live TV. Something like “wait five minutes to build this, and ignore if a new commit comes first?”

I’d enable a “build delay” variable on every site, immediately. I bet it would drastically reduce CPU for builds on many sites.

That is not a feature we have today, though it’s not a bad suggestion so I will get a feature request filed, though I do not expect it to be implemented soon since you are the first to ask for it.

If your CMS commits to git, we will skip intermediate builds while some are queued - but for most build hook triggered builds (I think you maybe use this feature to trigger a build on update from forestry? https://docs.netlify.com/configure-builds/build-hooks/).

So I guess you have a few options based on what’s available today:

  • reconfigure forestry not to send so many updates. Not sure if that is possible, but it is the best advice I know of. Some other headless CMS’s (contentful for instance) have a setting about how often they notify webhooks about changes - e.g. “on intentional save, not on autosave”). Maybe forestry has something similar?
  • don’t autopublish - do so manually. Use a build hook such as I linked BUT NOT FROM FORESTRY - instead, from something like a cron server, or a scheduled zap to build every hour during the editing day, or once a day. Or, only when someone pushes a button or runs an API call manually.
  • send the updates from forestry to an intermediary system like zapier which then triggers our builds selectively: Zapier can notice “I’ll only forward this if I haven’t just forwarded one in the past few minutes” or “I’ll notify about every 5th one” and other similar logic.

Except for reconfiguring forestry which I understand may not be possible or desirable for other reasons, I don’t love giving out workarounds that require other systems, but to accomplish your goal, that’s the best I have for you today.

That’s so cool, thanks for the reply.

Often, in a first-party application built by a tech company for a tech company, building from Circle or elsewhere would provide ample control, but in this particular use case, we are trying to cater to small business “mom and pop” users who are minimally tech-savvy (hence Forestry). If Forestry has such a feature I would use it. Building on cron would likely not result in a net savings due to many days where no edits would happen at all. Zapier’s not a bad suggestion. All that said, if there could be a deploy-delay setting in Netlify, I’d think it would REALLY reduce overhead, likely more for Netlify than for me :wink:

Thanks again for filing the feature request

I get the same exact error as nicolasrouanne:

I tried creating a bash script as you suggested, I still get this message:

4:41:26 PM: Detected ignore command in Netlify configuration file. Proceeding with the specified command: './netlify-ignore.sh'
4:41:26 PM: Attempt to ignore dependabot deploys in script
4:41:26 PM: User-specified ignore command returned exit code 0. Returning early from build.
4:41:26 PM: Failed during stage 'checking build content for changes': Canceled build due to no content change
4:41:26 PM: Finished processing build request in 18.713326072s


Keep in mind that the command itself (git log... grep dependabot) works perfectly fine when run locally, it just does not work in netlify’s build process.

Edit: I just realized I have “dependabot” in my test commit, let me try removing it and seeing if the script works…

Edit2: It works! Thanks! I would suggest changing the original blog post to put the command in a script.

1 Like

Could you switch off the CI for this site too?

  • e6bab94d-3483-4da9-8969-f3e16b10f1cd

Thank you!

Hi, @lollypop3103, you can stop the builds with a site setting now:

This is not something that needs to be requested in community anymore and you can change the setting yourself anytime.

Hi, @luke
Thank you for the information.
I’m sorry. I seem to have been referring to an old document.
I’ll give it a try.

Thank you.