sitescache.txt 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. MediaWiki's SiteStore can be cached and stored in a flat file,
  2. in a json format. If the SiteStore is frequently accessed, the
  3. file cache may provide a performance benefit over a database
  4. store, even with memcached in front of it.
  5. Configuration:
  6. File-based caching can be enabled by setting $wgSitesCacheFile
  7. to the file path of the cache file.
  8. The file can then be generated with the rebuildSitesCache.php
  9. maintenance script.
  10. Format:
  11. In the sites cache file, sites are listed in a key-value
  12. map, with the key being the site's global id (e.g. "enwiki")
  13. and a key-value map as the value. The site list is wrapped
  14. with in a "sites" key.
  15. Example:
  16. "sites": {
  17. "aawiktionary": {
  18. "globalid": "aawiktionary",
  19. "type": "mediawiki",
  20. "group": "wiktionary",
  21. "source": "local",
  22. "language": "aa",
  23. "localids": [],
  24. "config": [],
  25. "data": {
  26. "paths": {
  27. "file_path": "http:\/\/aa.wiktionary.org\/w\/$1",
  28. "page_path": "http:\/\/aa.wiktionary.org\/wiki\/$1"
  29. }
  30. },
  31. "forward": false,
  32. "internalid": 2666,
  33. "identifiers": []
  34. }
  35. }