-
Kristian Klausen authored
We have used MediaWiki's file cache[2] until now, but recently the wiki has been hammered with requests from some stupid Chinese bots/crawlers. Caching at the web server level is faster as we avoid the PHP overhead and it seems to make a difference (performance wise), especially when the bots/crawlers are hitting us. This is usual done with Varnish[3], but I went with a simple Python service (30 LOC) for handling the PURGE requests as that is much simpler thn adding Varnish to our stack. [1] https://www.mediawiki.org/w/index.php?title=Manual:Performance_tuning&oldid=6670283#Page_view_caching [2] https://www.mediawiki.org/wiki/Manual:File_cache [3] https://www.mediawiki.org/wiki/Manual:Varnish_caching Fix #315
Kristian Klausen authoredWe have used MediaWiki's file cache[2] until now, but recently the wiki has been hammered with requests from some stupid Chinese bots/crawlers. Caching at the web server level is faster as we avoid the PHP overhead and it seems to make a difference (performance wise), especially when the bots/crawlers are hitting us. This is usual done with Varnish[3], but I went with a simple Python service (30 LOC) for handling the PURGE requests as that is much simpler thn adding Varnish to our stack. [1] https://www.mediawiki.org/w/index.php?title=Manual:Performance_tuning&oldid=6670283#Page_view_caching [2] https://www.mediawiki.org/wiki/Manual:File_cache [3] https://www.mediawiki.org/wiki/Manual:Varnish_caching Fix #315
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
nginx-cache-purge.service.j2 204 B
[Unit]
Description=nginx cache PURGE service
[Service]
User=http
ProtectSystem=strict
ReadWritePaths=/var/lib/nginx/cache
ExecStart=/usr/local/bin/nginx-cache-purge
[Install]
WantedBy=multi-user.target