📜 ⬆️ ⬇️

Tame and pump firelight: The Ultimate Guide

Subjugate this 9-tailed fox

Lyrical introduction


I do not like the race of versions, its senselessness vaguely reminiscent of the arms race. We did not have time to properly update the current version - they release a new one, with new bugs, vulnerabilities and “features”. For people like me - lovers of stable and proven solutions for the corporate environment, and for myself too - the Mozilla team has an ESR-type build : for a long time there are updates for it that fix bugs and vulnerabilities, the major version of the browser itself is not updated! Here is a link to the off.site page, where you can download this wonderful ESR version (achieved by not very obvious moves), also, the ESR can be downloaded from official FTP ftp.mozilla.org/pub/firefox/releases/latest-esr/
The expected 17th ESR version has just been released by me a long time ago (the previous one was only the 10th). In connection with this event, I decided to write a detailed guide to optimize our (not) favorite browser - with analysis of all the parameters that each of them does and where it came from.

Part 1. To Mozilla not slowed down


1. To his surprise, he discovered: the characteristic inhibition, which many probably faced, is caused by a built-in script that defines the system proxy settings .
If there is no proxy, we indicate this explicitly : “settings - in addition - network - connection” - “without proxy”. If our fox works in a corporate environment, if possible, we explicitly set a proxy or the proxy.pac script
2. Minimum add-ons : do not install the extra ones, of those that are set, we keep only those that are really needed included. Remember: an extra plugin is a waste of computational resources when drawing each page. Actually plugins: disable everything to the maximum, and first of all dotnet, DRM, java quick start. In the corporate environment, we take measures so that these plug-ins do not appear in the list of installed ones at all.
3. Volume limitation and automatic optimization of the places database - places.sqlite file. The first is achieved by the max_pages parameter (see below), the second (theoretically) occurs regularly once a month. In modern versions of FF, unfortunately, the interface does not provide settings for limiting the storage time and the size of the history of page visits. Naturally, this add-on can fill this gap. As an alternative to forcing the restriction of the number of pages in the history, I recommend the PlacesCleaner addon: it clears and optimizes the database at a specified interval (in days). If you only need frequent optimization, and the number of pages is already set hard through the config, the Vacuum Places Improved addon may be interesting.
4. Limiting the cache size to a reasonable size - explicitly specify in the settings (or via pref ). I think it is clear to everyone: gigabytes of files scattered across the disk and indexes of all this speed will not add.

Part 2. Getting rid of unwanted content


Long gone are the days when the problem was loading, in fact, advertising banners in gif format. Now evil is counters and centralized banner networks, spying, and, moreover, for the user: first, the scripts that are heavier than the “payload” —the advertising graphics itself; second, the centralized nature: the increased load on their server and the case leads to a delay in uploading their content, rather than downloading it, the browser postpones the rendering of the page - as a result, we wait even with fast Internet ... And the dominance of flash advertising? It represents “now” compared to “then” an incomparably big problem: just look at how much memory is spent on the plugin-container process - comparable to the browser itself: new versions of the adobe flash player have become very voracious and every extra flash banner should be considered as an extra open application!
The following are solutions to the problem of unwanted content, the most interesting from a technical point of view:
1. Family of add-ons adblock - the most convenient and, as a result, a popular tool.
Details
Of all their diversity, I recommend paying attention to 2: Adblock plus - the most recent version of the add-on, and its alternative to the Adblock edge. Advantages: start blocking ads immediately after installation (“out of the box”), can block any content (pictures, flash, scripts) and even remove HTML containers specified in the black list directly from the page (by id, class ...), you can how to add ready-made subscriptions, and make your own rules.
Disadvantages: RuAdlist + Easylist added subscription added by default ( attention! ) Does not block counters; ready-made sets of rules from subscriptions are too long lists, which is fraught with a waste of computational power and RAM; you need to learn your own Adblock syntax if you want to create your own rule manually.
To easily solve the problem with the counters, add the “Against counters” list to the subscription : https://ruadlist.googlecode.com/svn/trunk/cntblock.txt , it is lightweight - 12 kb and is the only subscription mentioned here that does not lead to increased resource consumption by the browser. But it does not block the google-analytics script, so you still need to add the rule ||google-analytics.com/ga.js
There is also a list of BitBlock - so that plug-ins from social networks are not loaded - Facebook buttons, google +, etc., http://ruadlist.googlecode.com/svn/trunk/bitblock.txt . All these additional filters can be installed in 1 click on their developer’s page: https://code.google.com/p/ruadlist/
It must be remembered that subscriptions contain a huge number of rules, mostly unnecessary, which significantly slows down the loading of heavy and complex pages (like image search results in Yandex and Google) increases memory consumption: up to 120 MB with three subscriptions against 56 MB with Adblock no rules (the browser shows 1 tab with a blank page). If, in the presence of a pair of direct hands, we don’t want to sacrifice speed and waste extra memory, we delete all subscriptions (except, perhaps, “against counters”) and create the rules ourselves: manually universal rules, and on frequently visited sites we block all banners in visual mode , first of all, flash (the adblock has the ability to show the list of elements and sometimes create a rule by clicking the mouse directly on the undesirable element). The result of our work is stored in the FF profile in the adblockplus subdirectory (adblocklite) and these settings can now be replicated along with the plugin to others * upd * And also about adblock plus: for better performance, be sure to turn off in the settings (add-on button, drop-down menu) filter response ”! Adblock with each hit shovels megabyte (in case of subscriptions) patterns.ini - looked there and was horrified. It is not by chance that Adblock edge and adblock lite are shipped with the filter response count disabled by default. Read more about optimizing Adblock here .

2. noscript, yesscript - blocking scripts, helps to defeat such evil as counter scripts and banner networks.
Details
noscript works on the whitelist principle, there is a preset whitelist, yesscript - on the blacklist principle.
Disadvantages for noscript: specialization in blocking scripts, impossibility of compromise: blocks scripts even for the domain of the page opened on this tab, which will surely spoil the performance of many sites, and in case of installing the checkbox, “completely allow javascript execution” (in my opinion, the only acceptable mode) and adding separate scripts (for example, counters) to the black list - the black list itself cannot be seen in the settings (or set in advance). Well, yesscript - which implements an adequate blacklist algorithm - due to the scarcity of settings can disappoint even a fan of minimalism: there is only a list of URLs (reg. Expressions?) Where to block scripts, it needs to be created independently. For comparison: Adblock, if you use only samopisny rules in it, will also block the script, but besides it, you will also see pictures, flash, and whole blocks of HTML code right on the page. The difference is obvious.

3. imglikeopera - a very interesting plugin, undeservedly deprived of popularity. Blocks pictures and flash.
Details
The idea is borrowed from the "Opera" - a button that controls the display of pictures.
Advantages: can forcely cache graphic content for a long time, supports regular expressions. Disadvantages: does not contain pre-installed rule sets - everything is set manually, does not manage scripts (but was experimentally doped by me to add this opportunity - the impressions cause mixed), to the source code of the page it adds extra ilo-full-src parameters to the tags and when saving pages they are there.

4. Configuration parameter plugins.click_to_play
Details
and the simplest addon switch-plugins_click_to_play , which creates a button that controls this parameter. A very effective and compatible with previous solutions method to eliminate memory erosion and CPU load with flash content in the face of the plugin-container process. When click_to_play is enabled, a gray block appears on the site of the flash banner with the words “click here to enable the plugin”, and a notification appears at the beginning of the address bar by clicking on which you can configure the launch of the plugin for this site.

')

Part 3. The correct default settings


The easiest way to deploy FF with the given settings is to put a js-file similar to the prefs.js profile in the directory [FF installation path] / defaults / preferences . I call it the same as in the profile - prefs.js, but the name is not important, the main thing is to have the extension .js
So, create a js-file with the following contents:
* upd *
 # Mozilla User Preferences pref("app.update.enabled", false); pref("browser.cache.memory.max_entry_size", 256); pref("browser.cache.memory.capacity", 4096); pref("browser.display.show_image_placeholders", false); pref("browser.download.manager.retention", 1); pref("browser.download.useDownloadDir", false); pref("browser.feeds.showFirstRunUI", false); pref("browser.newtabpage.enabled", false); pref("browser.places.importBookmarksHTML", false); pref("browser.privatebrowsing.dont_prompt_on_enter", true); pref("browser.rights.3.shown", true); pref("browser.safebrowsing.enabled", false); pref("browser.safebrowsing.malware.enabled", false); pref("browser.search.update", false); pref("browser.sessionhistory.max_total_viewers", 1); pref("browser.shell.checkDefaultBrowser", false); pref("browser.startup.page", 0); pref("browser.tabs.animate", false); pref("browser.xul.error_pages.expert_bad_cert", true); pref("config.trim_on_minimize", true); pref("dom.event.contextmenu.enabled", false); pref("extensions.blocklist.enabled", false); pref("extensions.shownSelectionUI", true); pref("extensions.update.enabled", false); pref("extensions.update.notifyUser", false); pref("extensions.pendingOperations", false); pref("geo.enabled", false); pref("gfx.direct2d.force-enabled", true); pref("gfx.font_rendering.directwrite.enabled", true); pref("layers.acceleration.force-enabled", true); pref("intl.charsetmenu.browser.cache", "windows-1251, UTF-8"); pref("intl.charset.default", "windows-1251"); pref("intl.charsetmenu.browser.cache.size", 2); pref("network.cookie.prefsMigrated", true); pref("network.dns.disableIPv6", true); pref("network.http.pipelining", true); pref("network.http.pipelining.max-optimistic-requests", 2); pref("network.http.proxy.pipelining", true); pref("network.http.request.max-start-delay", 1); pref("network.prefetch-next", false); pref("places.history.expiration.max_pages", 400); pref("plugins.hide_infobar_for_outdated_plugin", true); pref("privacy.donottrackheader.enabled",true); pref("security.warn_entering_weak", false); pref("security.warn_viewing_mixed", false); pref("toolkit.telemetry.prompted", true); 

There may be several js files in defaults / preferences. This is convenient: the optional parameter block is localized in a separate file, it can be put on a specific PC on the network or deleted from there.

It is easy to make your FF distribution kit for Windows with the correct settings: unpack the installer, you can safely delete the win32 directory, in the core directory you can find what is written in the program files. Put our js-file with the correct settings in core \ defaults \ preferences. You can immediately remove maintenanceservice_installer.exe and maintenanceservice.exe - do not litter your PC with unnecessary services. The resulting unpacked distribution can be installed manually or deployed in all possible ways - just like the original exe distribution: setup.exe accepts all the same keys.

Part 4. Details on what each parameter does


Sources:
{1} solution found by me
{2} www.latestonnet.com/2012/01/17/optimize-firefox-to-run-4-times-faster-than-before.html
{3} sonikelf.ru/optimizuruem-firefox
{4} egonitron.com/2007/05/25/the-truth-about-the-firefox-pipelining-trick
{5} techlogon.com/2012/12/02/how-to-speed-up-firefox-tweaking-guide
Original source (albeit for older versions): http://kb.mozillazine.org/Category:Preferences

To begin with about the strategy . Unlike many mountain optimizers, I don’t want to change every setting in everything, including all the subtleties of the system’s behavior at a low level. Instead, the following directions are being worked out consciously and with common sense:
1) prevent the causes of "brakes"
2) disable all unnecessary and interfering functionality - notifications, big brother anti-spoofing, ipv6 etc.
3) RAM saving
4) enable HTTP 1.1, but without extremism

no annoying updates without asking
 pref("app.update.enabled", false); pref("browser.search.update", false); pref("extensions.update.enabled", false); pref("extensions.update.notifyUser", false); pref("extensions.pendingOperations", false); pref("extensions.blocklist.enabled", false); 
{one}

memory optimization
 pref("browser.sessionhistory.max_total_viewers", 1); 
the number of pages stored in RAM, for a quick transition back - reducing the value of saving memory; It is recommended to put 0, but I (as in {2} ) consider the optimum 1: in most cases, we need to return exactly 1 step, and here the fox will please us with its speed;
 pref("browser.cache.memory.max_entry_size", 256); pref("browser.cache.memory.capacity", 4096); pref("config.trim_on_minimize", true); 
RAM cache size {1} , {3}
unloading memory pages when minimizing the window {3}

Attention: browser.cache.memory.capacity = 4096 means that 4 MB will be allocated to the cache in memory (value in KB). If there is obviously a lot of free memory, it is rational to set the values ​​many times more. On the other hand, the minimum cache size means that everyone in the corporate environment will have enough memory ...
browser.cache.memory.max_entry_size means the maximum size of an object cached in memory (value in kb). In theory, the smaller, the more efficiently the memory is consumed. Often (as in {3} ) is incorrectly taken as the parameter that determines the size of the cache itself. Confirmation of my words - in the browser itself, look here: about: cache? Device = memory
It can be seen that the browser.cache.memory.capacity we specified is exactly displayed in the “Maximum storage size” line.

disaccustomed to extra questions
 pref("browser.shell.checkDefaultBrowser", false); 
no annoying offers to be the default browser {1}
 pref("browser.feeds.showFirstRunUI", false); pref("browser.rights.3.shown", true); pref("extensions.shownSelectionUI", true); pref("toolkit.telemetry.prompted", true); pref("browser.places.importBookmarksHTML", false); pref("browser.privatebrowsing.dont_prompt_on_enter", true); 
firefox does not show self-advertisement and unnecessary reminders when you first start {1}

oppose the collection of information
 pref("geo.enabled", false); pref("browser.safebrowsing.enabled", false); pref("browser.safebrowsing.malware.enabled", false); pref("privacy.donottrackheader.enabled",true); 
turn off Google spying and phishing URLs - speeds up work: the browser makes fewer moves {1}
send the header “do not track” {1}

interface, usability
 pref("browser.startup.page", 0); pref("dom.event.contextmenu.enabled", false); pref("browser.download.manager.retention", 1); pref("browser.download.useDownloadDir", false); pref("places.history.expiration.max_pages", 400); pref("browser.newtabpage.enabled", false); pref("browser.tabs.animate", false); pref("browser.display.show_image_placeholders", false); 
open a blank page by default - ideal for corporate environment {1}
do not allow sites to disable context menu {1}
the fox does not foul up when downloading the question is asked where to download {1}
clear download history when exiting FF {1}
we limit the maximum number of guaranteed records stored in history to 400: this approach to limiting the size of the places base without plug-ins is the only possible one on modern versions of FF (understood from the sources and confirmed experimentally) {1}
in the new tab we show by default a blank page without tiles {1}
disable animation tabs {5}
do not show space for pictures - speeds up the drawing {5}
 pref("plugins.click_to_play",true); 
optional: do not load plugins automatically - fix the problem of voracious flash content {1}

graphics hardware acceleration
 pref("gfx.direct2d.force-enabled", true); pref("gfx.font_rendering.directwrite.enabled", true); pref("layers.acceleration.force-enabled", true); 
Forcing a graphics accelerator: the browser is more demanding on the video driver and the GPU than the game !? We say a firm "no" to this misunderstanding! {one}

encodings
 pref("intl.charsetmenu.browser.cache", "windows-1251, UTF-8"); pref("intl.charset.default", "windows-1251"); pref("intl.charsetmenu.browser.cache.size", 2); 
what character sets are caching
default page encoding {1}
how many character sets we cache (default 5) {1}

network settings
 pref("network.dns.disableIPv6", true); pref("network.http.pipelining", true); pref("network.http.proxy.pipelining", true); pref("network.http.request.max-start-delay", 1); pref("network.http.pipelining.max-optimistic-requests", 2); # ,  # pref("network.http.max-persistent-connections-per-server", 8); # pref("network.prefetch-next", false); 
{1-5}
disables anyone not needed IPv6
Enable HTTP1.1 (multiple requests in one connection) for direct connection and proxy, respectively.
the delay before the maximum number of keep-alive connections is exceeded, the default is 10 (s), 0 is recommended in {2}, I think that it is better to set not 0, but 1, saving some delay
reduction of max-optimistic-requests from 4 to 2 according to the results of my experiments eliminates the delay in opening pages when working through HTTP1.1;
recommend an increase from 6 (default) to 8 max. the number of persistent connections with 1 server, which I personally do not recommend, on the contrary, you can try reducing to 4 or even 2 (as in IE5 and 6, which has never had problems with HTTP1.1);
Disabling the preloading of the following pages in the corporate environment - the desired setting

"security"
 pref("security.warn_entering_weak", false); pref("security.warn_viewing_mixed", false); pref("browser.xul.error_pages.expert_bad_cert", true); 
Disabling useless questions about weak encryption and mixed content, to which all users will still answer "yes" {1}
improve usability in a warning about a self-signed certificate - save clicks (this warning cannot be completely removed) {1}

drawing pages
 pref("content.notify.backoffcount", 5); pref("content.notify.ontimer", true); pref("content.interrupt.parsing", true); pref("content.notify.interval", 750000); 
low-level page rendering settings before loading;
often recommend content.notify.backoffcount = 5, but no one says that you need to include content.notify.ontimer, so that the first setting affects something
(experimentally, I cite this block due to the fact that earlier
constantly recommended content.notify.backoffcount = 5)

todo : to find a way to disaccustom the FF to swear for an invalid certificate, but so far I have not found such a setting

Source: https://habr.com/ru/post/161053/


All Articles