How to fix a slow loading Wiki page
Problem
When viewing your Bitbucket Cloud wiki, you may notice it slow to load and then finally getting the following error:
Cause
The wiki is essentially just another repo itself – If you have a very active wiki, there is a good chance that the repo is filled with loose objects and old, expired refs that are just taking up space. All of this added junk will cause you a timeout on the server, giving you the error above.
Resolution
First, clone the wiki to your local machine:
$ git clone git@bitbucket.org:your_account/your_repository.git/wiki
$ cd wiki/
Try expiring old refs and doing some git garbage collection:
$ git reflog expire --expire="1 hour" --all
$ git reflog expire --expire-unreachable="1 hour" --all
$ git prune --expire="1 hour" -v
$ git gc --aggressive --prune="1 hour"
$ git push --all
If this doesn't work, please contact Bitbucket Cloud support, and we will look into it.