With more than 2 million page views every month Kavita Kosh is a very popular website. So, it is not surprising that Kavita Kosh has crossed the CPU time limit during peak time and been blocked by the host twice. Therefore, I needed to take steps to speed up MediaWiki. To reduce the load on CPU –I decided to enable file caching in Kavita Kosh. MediaWiki has a simplistic caching scheme and it caches aggressively. To enable file caching in MediaWiki 1.17 –you should use the following three variables in LocalSettings.php Once the caching is on –MediaWiki begins to keep an HTML copy of every requested page in a file cache (by default it is /wiki/cache directory)… Further request for a page is met by sending the cached HTML page to the client. Remember, MediaWiki caching scheme affects only the anonymous users. Logged in users will get fresh page every time they’ll request one. This clearly means that the page seen by the anonymous users would be out-of-date if there has been changes after it was cached. I am, at present, facing exactly the same problem. Although, as a temporary measure, I can purge the present cache in order to force MediaWiki to generate fresh pages from the mysql database on future requests. But in a rapidly updated wiki this solution might not hold good for long. You can purge MediaWiki cache in any of the following ways: First three methods work well. But the fourth method is like a catch 22 situation. Extending MediaWiki with Purge extension is a good idea but it will not work unless you invalidate the existing cache. If you’ll not invalidate the existing cache the old files will not show the newly added Purge tab! Instead of extending MediaWiki you may choose to simply add a purge link directly on page. This can been done by modifying MediaWiki:Sidebar page. Add the following to create a link: These are temporary solutions. MediaWiki is not great at managing cache. So, for long term solutions, you should consider either of following options (or may be both): I hope this showed you the way on how to clear MediaWiki cache. Do let me know if you have any questions. Thank you for using TechWelkin. Comment * Name * Email * Website

Δ

Purge and Clear MediaWiki Cache to Flush All Pages - 3