From bd03c5ec0884b0bd0ea6c0b4bfbddc3d23556d73 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 12 Nov 2026 15:37:26 -0500 Subject: [PATCH] Disable firefox's disk cache and limit memory usage. --- nix/configuration/roles/firefox/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nix/configuration/roles/firefox/default.nix b/nix/configuration/roles/firefox/default.nix index 330c3f1..cf56f8e 100644 --- a/nix/configuration/roles/firefox/default.nix +++ b/nix/configuration/roles/firefox/default.nix @@ -84,6 +84,13 @@ "browser.ml.enable" = false; "browser.ml.chat.enabled" = false; "browser.ml.chat.menu" = false; + + # Disable disk-based caching to reduce writes to SSDs. My machines have plenty of RAM. + "browser.cache.disk.enable" = 0; + # Max memory for cache in KiB (set to 1 GiB). This defaults to unbounded (-1). + "browser.cache.memory.capacity" = 1048576; + # Only keep the previous 5 pages in memory for the back button. This defaults to unbounded (-1). + "browser.sessionhistory.max_total_viewers" = 5; }; # Check about:policies#documentation and https://mozilla.github.io/policy-templates/ for options. policies = {