Topic on Project:Support desk

星耀晨曦 (talkcontribs)

Now, I am using PHP OPcache in my wiki. But I saw this parameter that $wgMainCacheType,and the manual showed the following:"CACHE_ACCEL – APC, APCu, WinCache or XCache if available.." OPcache is an upgraded version of APCu. So, should I set CACHE_ACCEL?

24.39.1.139 (talkcontribs)

You could try that.

星耀晨曦 (talkcontribs)

Performance is not much change...

Ciencia Al Poder (talkcontribs)

OPcache is for caching PHP code when it's executed, so PHP doesn't need to reparse every PHP file each time. This is not controlled by MediaWiki. The caching that MediaWiki controls is storing data into a cache, so when it needs to be retrieved, it can be retrieved from the cache and not from database or recomputed by doing expensive queries. You should check first if OPcache can actually store data, otherwise MediaWiki may be just ignoring this setting.

星耀晨曦 (talkcontribs)

I can be sure that the OPcache extension has been installed.

How can I check OPcache can store data?

This post was hidden by 2002:43F4:3186:1234:710F:E53E:B40B:1404 (history)
This post was hidden by 2002:43F4:3186:1234:710F:E53E:B40B:1404 (history)
Ciencia Al Poder (talkcontribs)

If you're using this OPCache, it can't store data in memory. It only saves the compiled PHP sources. This is not an upgraded version of APCu

星耀晨曦 (talkcontribs)

Alright, I got it. So, should I set CACHE_NONE in the parameter?

Ciencia Al Poder (talkcontribs)

You may want to leave it as the default: CACHE_ANYTHING. It will try to use the database for caching, which should be better than no caching at all, unless the database is slow or you have space restrictions.