Skip to content

Instantly share code, notes, and snippets.

@RubenKelevra
Last active May 29, 2025 01:49
Show Gist options
  • Save RubenKelevra/fd66c2f856d703260ecdf0379c4f59db to your computer and use it in GitHub Desktop.
Save RubenKelevra/fd66c2f856d703260ecdf0379c4f59db to your computer and use it in GitHub Desktop.
Make Firefox fast again

Recommended Extentions:

uBlock Origin

https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/

Settings

Make sure the following options are off:

  • Disable pre-fetching

Rationale: Not doing this will significantly slow down navigation, as Firefox won't prefetch any content before clicking.

JSLibCache

https://addons.mozilla.org/en-US/firefox/addon/jslibcache/

Settings

Make sure the following options are on:

  • Allow header modification

Rationale: Otherwise many Javascript libraries won't be fetched from local storage - as they have parameters on their URLs in the HTML code. This isn't going to break any website.`

Make sure to copy the uBlock rules provided, to your uBlock settings, to avoid uBlock interfering:

  1. Go to the uBlock rules
  2. copy them
  3. Open uBlock's Dashboard
  4. Go to the My rules tab
  5. Paste them & hit Save, then Commit

Cache Longer

https://addons.mozilla.org/en-US/firefox/addon/cache-longer/

Set and forget.

Rationale: Increases the time items will be stored in the browser cache. This increasing the chance that network ressources won't need to be fetched. As NVMe/SSD storage is cheap and lightning fast compared to network requests, this has the potential to improve load times significantly.

Recommended Browser settings

Normal Browser settings

  1. Go to about:preferences#privacy
  2. Select Custom
  3. deactivate all filters in this section
  4. Scroll down to Security -> Deceptive Content and Dangerous Software Protection
  5. Disable Block dangerous and deceptive content

Rationale: Those filters use a lot of CPU time to process, and are not very helpful - except for newbies. The Dangerous Software filters may actually even block downloads the user want to fetch, that's why it is recommended to disable these.

about:config settings

General tweaks

network.captive-portal-service.enabled = false # don't try to find captive portals
network.notify.checkForProxies = false # don't try to find proxies

Browser cache

browser.cache.disk.capacity = 8192000 # Increase cache size on disk to 8 GB
browser.cache.disk.smart_size.enabled = false # force a fixed max cache size on disk
browser.cache.frecency_half_life_hours = 18 # lower cache sweep intervals
browser.cache.max_shutdown_io_lag = 16 # let the browser finish more io on shutdown
browser.cache.memory.capacity = 2097152 # fixed maximum 2 GB in memory cache
browser.cache.memory.max_entry_size = 327680 # maximum size of in memory cached objects
browser.cache.disk.metadata_memory_limit = 15360 # increase size (in KB) of "Intermediate memory caching of frequently used metadata (a.k.a. disk cache memory pool)"

GFX rendering tweaks:

gfx.canvas.accelerated = true
gfx.canvas.accelerated.cache-items = 32768	
gfx.canvas.accelerated.cache-size	= 4096	
layers.acceleration.force-enabled = false
gfx.content.skia-font-cache-size = 80	
gfx.webrender.all = true	
gfx.webrender.compositor = true	
gfx.webrender.compositor.force-enabled = true	
gfx.webrender.enabled = true	
gfx.webrender.precache-shaders = true	
gfx.webrender.program-binary-disk = true
gfx.webrender.software.opengl = true
image.mem.decode_bytes_at_a_time = 65536	
image.mem.shared.unmap.min_expiration_ms = 120000	
layers.gpu-process.enabled = true
layers.gpu-process.force-enabled = true
image.cache.size = 10485760
media.memory_cache_max_size = 1048576	
media.memory_caches_combined_limit_kb = 3145728
media.hardware-video-decoding.force-enabled = true
media.ffmpeg.vaapi.enabled = true

Increase predictive network operations

network.dns.disablePrefetchFromHTTPS = false
network.dnsCacheEntries = 20000
network.dnsCacheExpiration = 3600
network.dnsCacheExpirationGracePeriod = 240
network.predictor.enable-hover-on-ssl = true
network.predictor.enable-prefetch = true
network.predictor.preconnect-min-confidence = 20
network.predictor.prefetch-force-valid-for = 3600
network.predictor.prefetch-min-confidence = 30
network.predictor.prefetch-rolling-load-count = 120
network.predictor.preresolve-min-confidence = 10

Faster SSL

network.ssl_tokens_cache_capacity = 32768 # more TLS token caching (fast reconnects)

Disable network seperations

fission.autostart = false # disable enhanced protection between threads/processes of the browser (which uses LOADS of memory to do)
privacy.partition.network_state	= false # don't seperate the network state (e.g. the cache) by top level domains)

Reduce the number of processes

dom.ipc.processCount = 1
dom.ipc.processCount.webIsolated = 1

Rationale: By default Firefox launches as many processes as you got CPU cores. This is highly counter productive, as this leads to much more memory usage as necessary. In addition switching tabs may now result not only in having to load the content back from the swap into memory, but also swapped in duplicated libraries etc.

Finishing touches:

  • Restart firefox

Go to about:support then scroll down to "Places Database" and select "Verify Integrity". This will rewrite the database.

Scroll up again and select "Clear startup cache" on the right side.

  • Restart firefox

Nice to have extensions

I don't care about cookies

https://addons.mozilla.org/en-US/firefox/addon/i-dont-care-about-cookies/

Set and forget.

Bypass Paywalls Clean

https://addons.mozilla.org/en-US/firefox/addon/bypass-paywalls-clean/

Automatically bypass some paywalls.

Downside: Needs often new permissions, if an update adds a site to the supported list. - You'll get notified with an ! mark on your "hamburger menu" icon.

Consent-O-Matic

https://addons.mozilla.org/en-US/firefox/addon/consent-o-matic/

Set and forget.

Cookie AutoDelete

https://addons.mozilla.org/en-US/firefox/addon/cookie-autodelete/

Go to settings and make sure the following are off:

  • Show Notification After Automatic Cleanup
  • Enable Support for Container Tabs

SponsorBlock - Skip Sponsorships on YouTube

https://addons.mozilla.org/en-US/firefox/addon/sponsorblock/

Configure skip categories to your likings.

Changelog

2023-07-07

  • add browser.cache.disk.metadata_memory_limit
  • Remove "cache cleaning" from finishing touches (as it's not really necessary and confuses people)

2023-04-15

  • set layers.acceleration.force-enabled to false (as it may increase CPU usage)

2023-02-26

  • Remove uBlock Origin's Disable hyperlink auditing unckecking recommendation (no idea why I've added that)
  • Organize Settings for Add-Ons under headlines
  • Improve explanation of how to apply JSLibCache's uBlock rules
  • Add Rationale to some settings, to avoid that people have to google
  • Fix browser.cache.frecency_half_life_hours
  • Minor changes/fixes to formatting
  • Reduce process counter down to one
@MR-Diamond
Copy link

Hi, since Firefox 135.0 there is another new option/flag: dom.ipc.forkserver.enable; I've set it to true (currently I am on Firefox 135.0.1) and has made evidents performance increaseaments: Firefox consume less RAM and pages load faster.
My system info/HW:

Manjaro Linux, 16 GB DDR3 RAM, Firefox's profile on RAM, cpu Intel Core i5-3210M @ 4x 3.1GHz (Ivy Bridge); so: is a pretty old hardware, and after weeks I can confirm that dom.ipc.forkserver.enable set to true, has helped a lot.

@Milor123
Copy link

Hi, since Firefox 135.0 there is another new option/flag: dom.ipc.forkserver.enable; I've set it to true (currently I am on Firefox 135.0.1) and has made evidents performance increaseaments: Firefox consume less RAM and pages load faster. My system info/HW:

Manjaro Linux, 16 GB DDR3 RAM, Firefox's profile on RAM, cpu Intel Core i5-3210M @ 4x 3.1GHz (Ivy Bridge); so: is a pretty old hardware, and after weeks I can confirm that dom.ipc.forkserver.enable set to true, has helped a lot.

Thanks man, i want to try it in windows 11. should ir works there?

@MR-Diamond
Copy link

Thanks man, i want to try it in windows 11. should ir works there?

If you have at least Firefox 135.0, I think so. Try it out and report back.

@DWolf19
Copy link

DWolf19 commented Feb 26, 2025

I'm on 135.0.1 and I don't see dom.ipc.forkserver.enable available in about:config

@MR-Diamond
Copy link

I don't see dom.ipc.forkserver.enable available in about:config

Strtange, for me is here; proof:
Screenshot_2025-02-26_10-11-32

@DWolf19
Copy link

DWolf19 commented Feb 26, 2025

Linux Only

Ah..

@dezza
Copy link

dezza commented Mar 27, 2025

I don't care about cookies

  • Obsolete to uBlock Origin filter lists which also has several filter lists with cookies, plus you can add the https://www.i-dont-care-about-cookies.eu/abp/ if you still think you need more, but they are most likely overlapping.

Bypass Paywalls Clean

  • Also obsolete to uBlock Origin in many cases, but since uBlock API is limited there can be cornercases where an extension is needed, although I'd recommend against it.

Consent-O-Matic

  • Obsolete to uBlock Origin

Cookie AutoDelete

  • Builtin in Firefox, see privacy.clearOnShutdown maybe get inspiration from arkenfox settings.

@Anonymo
Copy link

Anonymo commented Mar 31, 2025

Thank you @RubenKelevra.
2. https://addons.mozilla.org/en-US/firefox/addon/bypass-paywalls-clean/ doesn't exist anymore. Any replacement, please?

There's a way to add a filter to ublock origin: https://raw.githubusercontent.com/liamengland1/miscfilters/master/antipaywall.txt I think you click import at the bottom of the filters tab.

@Milor123
Copy link

Milor123 commented Apr 2, 2025

Is a good idea use true in gfx.webrender.software.opengl = true for windows 11? or it is just for linux?

@Milor123
Copy link

Milor123 commented Apr 2, 2025

Other optimizations

I want to take this opportunity to mention these threads I found, about other optimizations in firefox

Part 1 - JIT threshold:

https://ra1ahq.blog/en/optimizaciya-proizvoditelnosti-mozilla-firefox

Summary of the conclusion (please read the above post)

Parameter name Default value New value
javascript.options.baselinejit.threshold 100 50
javascript.options.ion.threshold 1500 5000
network.buffer.cache.size 32768 65535
Parameter name Default value New value
javascript.options.concurrent_multiprocess_gcs.cpu_divisor 4 8
Parameter name Default value New value
browser.display.auto_quality_min_font_size 20 0 - 1000

Part 2 - dom.timeout

https://ra1ahq.blog/en/optimizaciya-proizvoditelnosti-mozilla-firefox-chast-2

Summary of the conclusion (please read the above post)

Parameter Default New value
dom.timeout.throttling_delay 30000 40
dom.timeout.budget_throttling_max_delay -1 0

Note

I have no idea if this will work, the publications where they talk about it seem a bit old but well conclusive. So please try it if you are an expert and let me know !

@trimechee
Copy link

Hi Mr @Milor123 and and to all who read my post,, thanks for all these awesome tricks :) 💯 🥇

I have request please: i use modified version of famous "Live stream downloader", i mean i delete the blocklist in v3/network and then put the extension in chromium and in firefox nightly which allows us the install of unsigned extensions (i convert v3 folder to zip format):

https://github.com/chandler-stimson/live-stream-downloader
https://github.com/chandler-stimson/live-stream-downloader/tree/master/v3

the problem, I have a weak wifi, playback videos in browser lag stuttering even with low SD quality, so I have to download the video, Live stream downloader extension allows us to display temporary HLS video in the download folder while downloading in chromium, but sadly in Firefox, temporary hls video is not displayed in my download folder and this is disaster because I need to playback temporary hls video with potplayer or vlc while downloadig because the download takes a long time and I don't like to wait for the slow download to finish ...

I tried everything in about:config, JavaScript flags, wasm flags, background flags, download flags, temporary flags...

I even contacted developers of Firefox forks and video downloader addons extensions to fix this problem... but I couldn't get temporary HLS video displayed while downloading using Firefox.

So please we hope the generous people who see my post will find a solution to this capital problem, which will save Firefox users the expense of upgrading to an expensive internet plan or buying a new, powerful computer.....because playing temporary video with Potplayer is better and smoother than HTML5 browser playback = fewer resources, better video quality... thanks :)

:

Video to test and download:
https://vidmoly.to/embed-yhrvmwlrpgzy.html

Eclipse-Community/r3dfox#266

chandler-stimson/live-stream-downloader#136

xifangczy/cat-catch#541

downthemall/downthemall#554

xifangczy/cat-catch#656

@kikislater
Copy link

@RubenKelevra Thanks for this gist and thanks to @Milor123 for more settings, it is nice to have a fast internet browser with privacy concern !

I'm a bit in doubt with

dom.ipc.processCount = 1
dom.ipc.processCount.webIsolated = 1

Whereas it is nice to reduce these 2 values, 1 is clearly unsable on most websites which have a lot of JS especially React JS, Redux or Angular JS. I'm not talking about social network platform but others where some people work or when JS enhance work ...
Reducing values reduce battery power consumption but reduce performance as well. The ideal IMO would be to have these values changes on demand if you are on battery or AC power ...

@srouquette
Copy link

it seems jslibcache was removed a month ago, I don't know why...

@chmichael
Copy link

chmichael commented May 5, 2025

Thanks for the update i replaced it with LocalCDN. Seems jslibcache is not in developement any more.

@srouquette
Copy link

srouquette commented May 5, 2025

LocalCDN doesn't work the same way, because JSLibCache was caching libs, instead or replacing requested libs with embedded ones, which may create problems.

There's a comment here: https://github.com/arkenfox/user.js/wiki/4.1-Extensions

edit: well, the original author recommends using LocalCDN...
https://gitlab.com/Jaaap/jslibcache/-/issues/12#note_2484029214

@srouquette
Copy link

srouquette commented May 8, 2025

youtube was leaking even when the tabs were closed (by checking about:memory). I added additionnal settings:

user_pref("media.mediasource.eviction_threshold.video", 157286400);

// if you don't use IPv6
user_pref("network.dns.disableIPv6", true);

// I don't use pocket or accessibility features
user_pref("extensions.pocket.enabled", false);
user_pref("accessibility.force_disabled", 1);

edit: still leaking...

@chmichael
Copy link

LocalCDN is causing a delay when you load a page for the first time so i removed it.

@Renkoto
Copy link

Renkoto commented May 21, 2025

// Disable network separations
user_pref("fission.autostart", false);
user_pref("privacy.partition.network_state", false);

I would recommend removing this in the user.js and putting it in with a huge warning, site isolation is a fundamental security feature in modern web browsers and disabling it makes your browser much more vulnerable to session hijacking and other kind of malware, as well as spectre-like vulnerability atttacks, Mozilla is already known for its poor approach to browser security compared to Chromium.

// Reduce the number of processes
user_pref("dom.ipc.processCount", 1);
user_pref("dom.ipc.processCount.webIsolated", 1);

This can actually decrease performance, especially on web applications and games, you should only disable it if you have a good reason for it.

user_pref("layers.acceleration.force-enabled", false);

Enabling this option can improve performance in some scenarios, rather than disabling browser core features, I would recommend setting up browser.tabs.unloadOnLowMemory to true.to enable automatic tab unloading, and managing browser.tabs.unloadOnLowMemory directly or with the use of an extension.

Please note that some features such as WebGPU and WebRender support are still experimental, the specifications are not fully implemented in Firefox yet, and may cause stability issues in some hardware configurations under Linux.

@nerdCopter
Copy link

@Renkoto's full comment makes sense to me.
additionally i had also found processCount set to half-of-total-cores works for me way better than 1. my firefox runs with no less than 20 to 30 tabs all day long and efficiency without saturating memory is key to my workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment