Hi,
I'm still trying to figure out what's the best solution for mobile subdomains combined with file caching.
I'm planning to copy the MediaWiki installation files for the mobile version to a separate folder (m) and link the subdomain to that folder while using the same database like the desktop version. Or is there a better way?
Can it cause any problems if one database shares two installations?
My setup:
OpenBSD 5.7 nginx 1.7.10 MediaWiki 1.25.1 PHP 5.4.38 (fpm-fcgi) MariaDB 10.0.16-MariaDB-log
LocalSettings.php:
# Memcached $wgMainCacheType = CACHE_MEMCACHED; $wgParserCacheType = CACHE_MEMCACHED; # optional $wgMessageCacheType = CACHE_MEMCACHED; # optional $wgMemCachedServers = array( "127.0.0.1:11211" );
$wgSessionsInMemcached = true; # optional
$wgUseGzip = true; $wgEnableSidebarCache = true;
# File cache $wgUseFileCache = true; /* default: false */ $wgFileCacheDirectory = "$IP/cache"; $wgShowIPinHeader = false;
# Text cache $wgCompressRevisions = true; $wgRevisionCacheExpiry = 3*24*3600; $wgParserCacheExpireTime = 14*24*3600;
# NO DB HITS! $wgDisableCounters = true; $wgMiserMode = true;
# MySQL performance tuning $wgAntiLockFlags = ALF_NO_LINK_LOCK | ALF_NO_BLOCK_LOCK;
# Image performance tuning $wgShowArchiveThumbnails = false;
# cron performance tuning
$wgJobRunRate = 0;
Thanks and cheers!
Till
On Wed, Jul 22, 2015 at 1:05 AM, Till Kraemer info@till-kraemer.com wrote:
Hi,
I'm still trying to figure out what's the best solution for mobile subdomains combined with file caching.
Why do you want file caching in the first place? It's a semi-supported kludge for people on shared hosts. You already use nginx, just set it up for HTTP caching.
I'm planning to copy the MediaWiki installation files for the mobile version to a separate folder (m) and link the subdomain to that folder while using the same database like the desktop version. Or is there a better way?
Don't duplicate files for multiple. There are vhosts and, in worst case, symlinks for that. And remember that mobile site is not even a separate wiki, it's just a different view of the same thing.
Can it cause any problems if one database shares two installations?
You would get a polluted parser cache containing URLs to both mobile and desktop site. That's why WMF rewrites the host header internally so that technically it looks like the same site to all code except for a few pieces that care about mobile.
$wgMainCacheType = CACHE_MEMCACHED; $wgParserCacheType = CACHE_MEMCACHED; # optional $wgMessageCacheType = CACHE_MEMCACHED; # optional $wgMemCachedServers = array( "127.0.0.1:11211" );
$wgSessionsInMemcached = true; # optional
For single-server setups, APC is faster than memcached.
$wgFileCacheDirectory = "$IP/cache";
Is it within webserver root? Looks dangerous.
Hi Max,
thanks a lot for your answer!
On 7/22/2015 11:29 AM, Max Semenik wrote:
On Wed, Jul 22, 2015 at 1:05 AM, Till Kraemer <info@till-kraemer.com mailto:info@till-kraemer.com> wrote:
Hi, I'm still trying to figure out what's the best solution for mobile subdomains combined with file caching.
Why do you want file caching in the first place? It's a semi-supported kludge for people on shared hosts. You already use nginx, just set it up for HTTP caching.
I thought file caching is a fast an easy solution, but thanks for your suggestion, I will give HTTP caching a shot.
I'm planning to copy the MediaWiki installation files for the mobile version to a separate folder (m) and link the subdomain to that folder while using the same database like the desktop version. Or is there a better way?
Don't duplicate files for multiple. There are vhosts and, in worst case, symlinks for that. And remember that mobile site is not even a separate wiki, it's just a different view of the same thing.
Yeah, I just thought this is the way to go, if I want file caching.
Can it cause any problems if one database shares two installations?
You would get a polluted parser cache containing URLs to both mobile and desktop site. That's why WMF rewrites the host header internally so that technically it looks like the same site to all code except for a few pieces that care about mobile.
Didn't know that. Thanks for pointing that out.
$wgMainCacheType = CACHE_MEMCACHED; $wgParserCacheType = CACHE_MEMCACHED; # optional $wgMessageCacheType = CACHE_MEMCACHED; # optional $wgMemCachedServers = array( "127.0.0.1:11211 <http://127.0.0.1:11211>" ); $wgSessionsInMemcached = true; # optional
For single-server setups, APC is faster than memcached.
Thanks, that's good to know! I'm gonna check out APC.
$wgFileCacheDirectory = "$IP/cache";
Is it within webserver root? Looks dangerous.
Thanks for the warning, but it's not. The path is actually /path/to/webserver/root/project_name/language_code/wiki/cache.
Cheers,
Till