How to optimize the SQLite databases in Firefox
Before we get started, make sure you have sqlite3 installed. For Ubuntu:
sudo apt-get install sqlite3
Close Firefox and run the following command in a terminal:
-For Firefox 3.0.*:
for f in ~/.mozilla/firefox/*/*.sqlite; do sqlite3 $f 'VACUUM;'; done
-For Firefox 3.5.*:
for f in ~/.mozilla/firefox-3.5/*/*.sqlite; do sqlite3 $f 'VACUUM;'; done
I suggest you make it a script and then put it in startup so that it will optimize your SQLite databases on each computer startup. To do this, create a new file in your home folder, let's call it: speed_ff.sh, and paste this in the file:
-For Firefox 3.0.*:
#!/bin/sh
for f in ~/.mozilla/firefox/*/*.sqlite; do sqlite3 $f 'VACUUM;'; done
-For Firefox 3.5.*:
#!/bin/sh
for f in ~/.mozilla/firefox-3.5/*/*.sqlite; do sqlite3 $f 'VACUUM;'; done
Then me have to make it executable. To do this, use the terminal to navigate to the folder where you created the speed_ff.sh file and:
chmod +x speed_ff.sh
Now, to run the script on every startup, go to System > Preferences > Startup Applications, click "Add", in the NAME field enter whatever you want and in the COMMAND field enter the full path to the newly created speed_ff.sh file.
-For Windows
Download IniFox which containts 2 files and extact the archive in the Firefox profile folder. The Firefox profile folder is in the following location:
- Windows XP: C:\Documents and Settings\[username]\Application Data\Mozilla\Firefox\Profiles\[randomcharacters.default]
- Windows Vista: C:\Users\[username]\AppData\Roaming\Mozilla\Firefox\Profiles\[randomcharacters.default]
- Windows 7: C:\Users\[username]\AppData\Roaming\Mozilla\Firefox\Profiles\[randomcharacters.default]
Windows users - you may also want to check out this post about speeding Firefox 3.5 startup too.
Credits for IniFox: infospyware
-For Mac OSX:
Close Firefox and run the following command:
cd ~/Library/Application\ Support/Firefox/Profiles/
for f in */*.sqlite; do sqlite3 $f 'VACUUM;'; done