Deleted files and directories are not removed when deploying

I usually build my websites on another CI/CD tool, that after building deploys to Netlify. I’ve noticed that if one of my projects initially builds a page that gets deployed, and that page is afterwards deleted, it is not removed once deployed to Netlify.

While the page is not accessible through links on the site it was still indexed by Google and is still accessible by direct link.

I tried building the project locally to confirm that the page is not generated. It is not, but it is still not removed from Netlify once deploying.

Is there way for me to either force a clean manual deploy, or deleted specific files/directories?

As a temporary solution I’ve added some forced redirects, but I would hope file deletion would be possible

By any chance are you using Cloudflare or another CDN in front of us? The only reason why a site would keep content from an old build is if it was cached elsewhere.

Failing that, you should look a little closer to home! Is it being aggressively cached by the browser?

Lastly, are you sure that these files aren’t in your latest build? You can download a copy of what we built and take a look.

Hi @Pie

I took at look at my CI provider (Buddy), and when copying the build artifacts form the Docker image it seems like they do some aggressive caching. I cleared the cache and after a deploy the files are gone.

Thanks you for your time.

1 Like