Manual:Reduce size of the installation

From MediaWiki.org
Jump to navigation Jump to search
This manual deals about aspects, on how to reduce the required web space of a MediaWiki installation to a minimum. Note that such playing around is not officially supported! Weighing the pros and cons, considering the amount of space available nowadays on the one and the breakage, which mistakes can easily cause on the other hand, such fiddling for 1 MB here and 250 KB there seems ridiculous. You are not encouraged to follow the content on this page!

Reducing the installation size (for a developer install)[edit]

The size of a MediaWiki 1.24 installation is around 95 MB, but you can reduce it to around 65 MB. The following points are examples, how you can free webspace.

  • If you are only using certain languages, you can delete about 30 MB of files in PHP language files in languages/messages/. For instance, if you are only using English, you can delete everything but the file that start with MessagesEn. Note that users can change the language in their user account. Your wiki will no longer work, if a user selected a language, of which you removed the files. You could solve that by hiding the option to change the language in the user preferences. However, the language can still be changed by adding "uselang=xx" to the URL of a page and you can not disable that in the user preferences. So if you want to avoid errors, do not delete language files.
  • You can also free up about 1 MB by deleting skins you don't use. Set a default skin using $wgDefaultSkin. Then, if you are using the Monobook skin, go into skins/ and delete everything but Monobook/. This frees up about 1 MB. Do not forget to make the skins inaccessable in LocalSettings.php, or you will run into nasty errors.
  • You can free up about 500 KB by deleting the HISTORY, RELEASE-NOTES, COPYING, UPGRADE files. However, these files are linked in Special:Version, but also on many other places. Deleting the files will create broken links at all these places.

End-User (not a developer install)[edit]

The MediaWiki 1.24 installation can be reduced to a size of 36.2MB, including all default skins. This is achieved by deleting all non-English messages, all developer features and by deleting a couple of the largest extensions that are installed by default, but are rarely used.

This installation cannot be used to develop the mediawiki software, but can be used for in-house installations if you are constrained by the size of the web hosting.

  • from folder /wiki - delete: README, INSTALL, Changelog, History, CREDITS, FAQ etc saves ~ 1Mb
  • the folder /wiki/docs/ - delete docs folder ~ 0.37Mb docs - (Contains various text files that should help you understand the most important parts of the code of MediaWiki.)
  • from folder /wiki/extensions/ - extensions. Each extension from the folder extensions/ can be deleted to reduce the size of the installation further. If extensions are removed, which actually are in use, the wiki will break. See Special:Version to see what you are actually running. Currently ~ 7.6Mb could be pruned, if needed.
  • from folder /wiki/languages/messages/ - languages - delete all except english .EN; saves about 40Mb - this can easily break your wiki, see notes in the section above.
  • the folder /wiki/tests/ - tests - delete the entire folder; 3.9Mb.

See also[edit]