Jekyll Not Updating My Page? Here's the Simple Fix

So, you’ve just made a change to a file in your Jekyll site, you hit save, reload your browser… and nothing. The old content is just sitting there. You double-check that you actually saved the file, maybe even force-refresh a few times.:face_with_raised_eyebrow: It’s super frustrating, and I’ve run into it more than a few times myself.

After some digging, I found it’s usually just a caching problem with how Jekyll builds the site. Luckily, the fix is quick and easy.

So, What’s Actually Going On?

Here’s the breakdown. Jekyll tries to be fast by only rebuilding the specific files you change—this is its “incremental build” feature. But sometimes, especially after switching git branches or if a previous build was stopped midway, its internal cache gets confused.

Think of it like this: your source files in the /docs directory are the raw ingredients. But what your browser actually sees is the final, built site in the _site folder. When Jekyll’s cache gets out of sync, it forgets to rebuild your new changes, so the _site folder still contains the old version of the page.

The Fix: Force a Clean Rebuild

The most reliable way to fix this is to just force Jekyll to rebuild everything from a clean slate. Here’s the simple workflow that always works for me:

  1. First, stop the running Jekyll server in your terminal (Ctrl + C).

  2. Next, completely delete the _site directory. This command does the trick:

    rm -rf docs/_site
    
  3. Finally, start the server again as you normally would:

    make docs
    

By deleting the _site folder, you’re wiping the slate clean. Jekyll has no choice but to rebuild the entire site from scratch using your latest source files.

It’s a simple trick, but it’s saved me a ton of headaches. Hope it helps you too. :wink:

1 Like

I have been duped by Jekyll’s build cache on more than one occasion. To help avoid confusion with cache, some of our Jekyll sites, have a make target that exclude use of the —incremental flag.

1 Like