Production releases

I have a Contentful CMS site and we are running about 18 minutes for a push to production. To me this seems pretty inefficient. When I work with Wordpress it is a 1-1 ratio of make a change to a page and publish THAT SINGLE PAGE to production, not the entire site.

How can I reduce the time to publish general page updates or new pages to site?

Can I remove pages like those set to draft status which often cause deployment errors anyway?

PLEASE help us help you by writing a good post!

  • we need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
  • Build problems? Link or paste the FULL build log & build settings screenshot

The better the post - the faster the answer.

hi there - generally speaking you shouldn’t be rebuilding every single page - maybe we haven’t cached something correctly yet?

here are some general guides that might be helpful:

@perry thank you.

I ran the diff and found that there are no diffs other than a slight difference in file size:

Thank you for helping me!

In every case this is the summary of a deploy

Yea it kind of looks like your rebuilding the site each time.

What are you using for the frontend to tie into contentful?
(im going to guess gatsby)

Me too but…

Dumb question how do I know?

What are you using on the frontend?

According to the website’s source, NextJS is the framework.

I personally don’t ave much experience with NextJS, but if someone else has, this little piece of information might help.

Thank you for this information.

I am hoping someone here can help me to only push out necessary files during normal content change pushes initiated via contentful publish.

From what I know, and I might be wrong about this, static website generators always build from start (with Gatsby being the exception as I guess it has a feature called incremental builds, however not all can use it). So, it’s always going to rebuild the entire thing.

After the build is complete, Netlify compares the hashes of all the files to publish and then updates only the files with new hashes. But for Netlify to be able to do that, a full build is necessary.

I’d recommend you to try and reduce your build time or get your build timeout increased to 30 mins.

Hi hrishikesh,

That is what I am trying to do: reduce build time. I cannot do that without controlling which files are contributed to a build - right?

Hoping someone has a solution to this issue :slight_smile:

You probably can. If you are trying to process images or if there are just too many files to build, that might make a difference. There also might be some dependencies taking up a lot of time compiling the code. Switching the framework is also an option, however that would be too much work.

However, as I can see, NextJS does support incremental builds: Next.js 9.5 | Next.js. That’s the feature you’re probably looking for. As you might have guessed, that might be a configuration that you would have to do on your end.

1 Like

Hey @Jennifer_G,
I’d echo @hrishikesh and say that you are looking for ISR! We currently have a Build Plugin to support the analogous thing in Gatsby (“incremental builds”), but we do not fully support Next.js ISR yet. You can see that the feature is currently a high priority for us:

I’d encourage you to follow that issue for when it ships.

1 Like

Thank you Jen - I am following now.

You can always try the netlify Next.js Cache Plugin too as a quick compare to see if you can reduce those times.