User:Rparle/scripts/purgebutton

From User:Rparle/monobook.js/purgebutton:

This function adds a 'Purge Cache' button beside the 'History' button on every article. The button is used to purge Wikipedia's cache of a page, so that it will be regenerated. This is sometimes necessary when changes are made to a template contained in the page. The function works by comparing the URL of the current page to the regular expression /^http:\/\/en\.wikipedia\.org\/wiki\//, which will match for article pages. It looks for a 'History' button and creates a new button, with the text 'Purge Cache', with the same URL as the 'History' button. The only change is in replacing action=history with action=purge. The new button is appended to the end of the link list so that it appears along with the 'History', 'Edit' and 'Move' buttons.

This function uses the standard functions of the HTML Document Object Model. It has been tested only on Mozilla Firefox and Safari 3.

This function has been convered to a Greasemonkey user script by Thetorpedodog. That version works on most (all?) wikimedia projects.