# Watch debounce configuration

**URL:** https://zola.discourse.group/t/watch-debounce-configuration/2666
**Category:** Feature requests
**Created:** [July 26, 2025, 9:15pm UTC](https://zola.discourse.group/t/watch-debounce-configuration/2666 "2025-07-26T21:15:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ccjmne](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/ccjmne/32/1499_2.png) [@ccjmne](https://zola.discourse.group/u/ccjmne)
#### Post date: [July 26, 2025, 9:15pm UTC](https://zola.discourse.group/t/watch-debounce-configuration/2666/1 "2025-07-26T21:15:35Z")

</div>

It’d be nice to add the ability for the user to configure a difference debounce value for the files watcher.

1 second seems quite excessive to me sometimes, when I could just edit my blog post and see it some handful of milliseconds afterwards on my second monitor.

---

<div class="post-metadata">

### Author: ![yashi](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/yashi/32/1508_2.png) [@yashi](https://zola.discourse.group/u/yashi)
#### Post date: [August 6, 2025, 2:58pm UTC](https://zola.discourse.group/t/watch-debounce-configuration/2666/2 "2025-08-06T14:58:34Z")

</div>

Something like this:

```auto
diff --git a/src/cli.rs b/src/cli.rs
index 4c6708f0..bddfe3b4 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -101,6 +101,10 @@ pub enum Command {
         /// Extra path to watch for changes, relative to the project root.
         #[clap(long)]
         extra_watch_path: Vec<String>,
+
+ /// Seconds to debounce file watcher events (allows fractional)
+ #[clap(long, default_value_t = 1.0)]
+ watch_delay: f64,
     },
 
     /// Try to build the project without rendering it. Checks links
diff --git a/src/cmd/serve.rs b/src/cmd/serve.rs
index 8dbb1e4c..2171a43e 100644
--- a/src/cmd/serve.rs
+++ b/src/cmd/serve.rs
@@ -429,6 +429,7 @@ pub fn serve(
     no_port_append: bool,
     utc_offset: UtcOffset,
     extra_watch_paths: Vec<String>,
+ watch_delay: f64,
 ) -> Result<()> {
     let start = Instant::now();
     let (mut site, bind_address, constructed_base_url) = create_new_site(
@@ -481,7 +482,7 @@ pub fn serve(
 
     // Setup watchers
     let (tx, rx) = channel();
- let mut debouncer = new_debouncer(Duration::from_secs(1), /*tick_rate=*/ None, tx).unwrap();
+ let mut debouncer = new_debouncer(Duration::from_secs_f64(watch_delay), /*tick_rate=*/ None, tx).unwrap();
 
     // We watch for changes on the filesystem for every entry in watch_this
     // Will fail if either:
diff --git a/src/main.rs b/src/main.rs
index cf5fe7bf..d9716dc6 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -89,6 +89,7 @@ fn main() {
             fast,
             no_port_append,
             extra_watch_path,
+ watch_delay,
         } => {
             if port != 1111 && !port_is_available(interface, port) {
                 console::error("The requested port is not available");
@@ -119,6 +120,7 @@ fn main() {
                 no_port_append,
                 UtcOffset::current_local_offset().unwrap_or(UtcOffset::UTC),
                 extra_watch_path,
+ watch_delay,
             ) {
                 messages::unravel_errors("Failed to serve the site", &e);
                 std::process::exit(1);

```

`notify_debouncer_full``s behaviour is not what I expect though.

---

<div class="post-metadata">

### Author: ![ccjmne](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/ccjmne/32/1499_2.png) [@ccjmne](https://zola.discourse.group/u/ccjmne)
#### Post date: [August 6, 2025, 6:36pm UTC](https://zola.discourse.group/t/watch-debounce-configuration/2666/3 "2025-08-06T18:36:33Z")

</div>

Hey, thanks @yashi. Yes, I arrived to pretty much exactly what you suggested.  
I actually already submitted a PR ‘cause I was too much in a hurry to take a look at the code:

> <https://github.com/getzola/zola/pull/2938>
>
> \- Introduce \`-d\` \`--debounce \<VALUE\>\` flag for \`serve\`
> \- Document \`serve\`'s \`--…debounce\` flag in \`cli-usage.md\`
> 
> Let the file watcher use a configurable debounce value.
> 
> This commit preserves the (until now hard-coded) 1-second debounce value
> as the default, but adds a new flag for the \`serve\` command, which lets
> the user configure a debounce duration for consecutive rebuilds in watch
> mode.
> 
> Closes #2937.

---

<div class="post-metadata">

### Author: ![ccjmne](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/ccjmne/32/1499_2.png) [@ccjmne](https://zola.discourse.group/u/ccjmne)
#### Post date: [October 25, 2025, 9:11pm UTC](https://zola.discourse.group/t/watch-debounce-configuration/2666/4 "2025-10-25T21:11:22Z")

</div>

Merged (to `next`) earlier this week!

I’ve no idea how to mark the discussion as “resolved”, though…
