Deploy times doubled

I use the cli to deploy from a Github action. The deploy times have doubled in the past few weeks.

CDN diffing files...

✔ CDN requesting 3160 files

- Uploading 3160 files

When I look at the cli output it says that it’s doing a CDN diff for approx 3000 files. Occasionally it dsays 19 files which is more close to actual files changed. When that happens deploy times are better.

In any case mostly it’s saying 3000, a lot more than I am changing.

Is there a way to get a list of files that it uploaded?

Are you sometimes changing things that are in your “globals”, for example in your header/footer, or perhaps a menu?

When outputting a static site those kinds of changes can impact every file.

Thanks for the reply.

Good point, I hadn’t thought about page headers. But to my knowledge I’m not changing anything there. I am literally just adding a few markdown files that contain new blog posts. Sometimes I might add some spelling mistake fixes, again though it’s just a few markdown files.

There’s nothing I can think of that would be entirely different on new renders, certainly not for thousands of files.

@mjgs If your site is a public repository you could link it, it should be easy to discern even just with local builds if changes to various files really are impacting thousands of files.

If thousands of files actually are changing, then Netlify is simply doing what it needs to.

I don’t have any public repos, just the site itself:

https://markjgsmith.com - landing page

Latest - markjgsmith.com - see the rest of the site here

How do I discern where the 1000s of files that are supposedly changing are?

@mjgs Sorry without a public repository I cannot do much for you.

Looking at the deployed site wouldn’t reveal any useful information at all in this case.

How do I discern where the 1000s of files that are supposedly changing are?

You could do this any number of ways, all you’re doing is discerning precisely what your build changes when it executes.

A simple way to do it would be to diff between the output of one build and another locally (after making an applicable change), along the lines of what Netlify is doing.

I’d expect you would find that the files have changed.

Just using the diff command on both directories? (New build and old build directories)

Do I need any special flags or options?

@mjgs I wasn’t referring to any specific diff operator, simply the concept.

Netlify’s system generates a SHA for each file and compares them with what already exists on the CDN.

It’s mentioned here:

I guess what I’m asking is what will produce the best output in case I need to post it in this thread. My worry with Linux diff is the output is a little difficult to parse.

I guess just a list of file names that are different, then we can compare with the pages on the live site?

Is that possible with Unbuntu Linux diff?

@mjgs I understand why you’re asking for specific instructions, but they’re not something I can provide to you.

I don’t work for Netlify, I’m only here to try and help fellow developers get ‘unstuck’ quicker than may otherwise occur if they wait for Netlify support, (and occasionally provide answers that Netlify support may not touch with a 1000ft pole).

I’m also happy to admit that I’m not an expert of using diff, as with a lot of things it’s the kind of tooling where I would need to google for an applicable answer matching my use case, or construct one using diff --help.

Since I’m not experiencing your problem, I’m not going to spend time doing actual implementation work. That probably seems mean, but there’s just a limit to how much time and effort I can dedicate to voluntarily assisting here.

It’s more about confirming for yourself if changing things you believe to be small, do in fact change many files throughout the site. On the balance of probability, and from my own historical experience, the Netlify system is probably correct. If the SHA’s have changed, the SHA’s have changed, they need to upload those files.

No worries thanks for your help

This is the list of files that had changed for this deploy: Deploy details | Deploys | gmzh | Netlify

export.csv (97.8 KB)

As for what exactly changed, you’d have to find that out. Something caused the SHA of these files to change, it could also be a single extra character. You can now probably check only a few files instead of diffing your entire folder.

Thanks for the update.

Why does the web UI say 3335 new files uploaded but then right afterwards it says 10 assets changed?

10 assets seems about right. If I add one blog post it will create updated index pages and the page of the actual post.

See screenshot.

The csv list thousands of files that haven’t changed. The Netlify UI even says only 10 assets changed. Why is it uploading all these files that didn’t change, doubling the deploy times?

The UI is showing 3325 files and 10 assets changed. You simply ignored (or missed) that line.

As for what changed, again as I said before, it’s for you to find out. It’s likely that the changed assets are being imported on all those pages. So a change in URL of those assets causes a change on all pages. Something described here:

and:

Thanks for the links.

I misunderstood the message. It wasn’t obvious that ‘file’ and ‘asset’ were not the same thing. I’m still not clear on what an ‘asset’ actually is. For a static site everything is a file.

Can you give me an example of an asset?

I ran the diff, first on an individual file listed in the csv you posted. There was no difference. See screenshots:



Then I ran the diff on the entire output directories from two successive builds. In between build1 and build2 I added a single blog post markdown file to the source data.

The diff listed 1 extra html file which was generated from the extra test markdown file. See screenshots:




So it appears to me that the diff is only finding the 1 extra file, not 3200 files.

The one caveat is that the diff command appears to have failed midway through. I can’t figure out the reason.

Is there a maximum number of files diff can handle?

What do you think is going on?

Looking at the output closer, the diff is listing the extra file in the sitemap.

I updated to use the -rq diff options.

Here’s the output:

Files dist/site/build1/blog/2015/index.html and dist/site/build2/blog/2015/index.html differ
Files dist/site/build1/blog/2018/index.html and dist/site/build2/blog/2018/index.html differ
Files dist/site/build1/blog/2019/index.html and dist/site/build2/blog/2019/index.html differ
Files dist/site/build1/blog/2020/index.html and dist/site/build2/blog/2020/index.html differ
Files dist/site/build1/blog/2021/index.html and dist/site/build2/blog/2021/index.html differ
Files dist/site/build1/blog/2022/index.html and dist/site/build2/blog/2022/index.html differ
Files dist/site/build1/blog/2023/index.html and dist/site/build2/blog/2023/index.html differ
Only in dist/site/build2/blog/2024/04/21: test-post
Files dist/site/build1/blog/2024/index.html and dist/site/build2/blog/2024/index.html differ
Files dist/site/build1/blog/index.html and dist/site/build2/blog/index.html differ
Files dist/site/build1/contacts/index.html and dist/site/build2/contacts/index.html differ
Files dist/site/build1/links/2023/07/18/173600-markjgsmith.com/index.html and dist/site/build2/links/2023/07/18/173600-markjgsmith.com/index.html differ
Files dist/site/build1/listofurls.txt and dist/site/build2/listofurls.txt differ
Error: Process completed with exit code 1.

The error is expected, that’s what diff does when it finds differences.

There are only a handful of files that are changing, mostly the archives index files which makes sense and the new test blog post.

Why does Netlify diff report 3200 files changing?