# Memory cache for shared hosting

**URL:** <https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126>\
**Category:** ℹ️ Support\
**Tags:** opcache\
**Created:** [August 3, 2016, 12:13pm UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126 "2016-08-03T12:13:08Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![sushidave](https://help.nextcloud.com/letter_avatar/sushidave/32/6_449c533f586939b6e5f246632a46421f.png) [@sushidave](https://help.nextcloud.com/u/sushidave)\
**Post date:** [August 3, 2016, 12:13pm UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/1 "2016-08-03T12:13:09Z")

</div>

Hello fellows,  
I just joined this forum and am happy to become part of the community!  
Could someone help me with this question?  
“How do you install and enable a local memcache as mentioned the admin manual ([https://docs.nextcloud.com/server/9/admin\_manual/configuration\_server/caching\_configuration.html](https://docs.nextcloud.com/server/9/admin_manual/configuration_server/caching_configuration.html)) but in a shared hosting environment?”

---

<div class="post-metadata">

**Author:** ![Soko](https://help.nextcloud.com/user_avatar/help.nextcloud.com/soko/32/100_2.png) [@Soko](https://help.nextcloud.com/u/Soko)\
**Post date:** [August 3, 2016, 12:18pm UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/2 "2016-08-03T12:18:41Z")

</div>

> [@sushidave](#):
>
> in a shared hosting environment

I fear that this is not possible, and I think activating memory cache is not essential

---

<div class="post-metadata">

**Author:** ![sushidave](https://help.nextcloud.com/letter_avatar/sushidave/32/6_449c533f586939b6e5f246632a46421f.png) [@sushidave](https://help.nextcloud.com/u/sushidave)\
**Post date:** [August 3, 2016, 12:21pm UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/3 "2016-08-03T12:21:16Z")

</div>

Oh, alright. Thanks for your help, Soko.

---

<div class="post-metadata">

**Author:** ![NickW](https://help.nextcloud.com/letter_avatar/nickw/32/6_449c533f586939b6e5f246632a46421f.png) [@NickW](https://help.nextcloud.com/u/NickW)\
**Post date:** [August 3, 2016, 1:58pm UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/4 "2016-08-03T13:58:27Z")

</div>

The following line in `config.php` works with OVH shared hosting:

`'memcache.local' => '\\OC\\Memcache\\ArrayCache',`

No guarantee that it will work with other hosting, but it’s worth a try. 😉

---

<div class="post-metadata">

**Author:** ![sushidave](https://help.nextcloud.com/letter_avatar/sushidave/32/6_449c533f586939b6e5f246632a46421f.png) [@sushidave](https://help.nextcloud.com/u/sushidave)\
**Post date:** [August 3, 2016, 2:37pm UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/5 "2016-08-03T14:37:59Z")

</div>

In fact, it works like a breeze here. Thanks for the magic 😉

---

<div class="post-metadata">

**Author:** ![nickvergessen](https://help.nextcloud.com/user_avatar/help.nextcloud.com/nickvergessen/32/66965_2.png) [@nickvergessen](https://help.nextcloud.com/u/nickvergessen)\
**Post date:** [August 3, 2016, 5:16pm UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/6 "2016-08-03T17:16:45Z")

</div>

The benefit of using arraycache is close to 0 thou 😉

---

<div class="post-metadata">

**Author:** ![aLpHa](https://help.nextcloud.com/user_avatar/help.nextcloud.com/alpha/32/756_2.png) [@aLpHa](https://help.nextcloud.com/u/aLpHa)\
**Post date:** [August 3, 2016, 7:02pm UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/7 "2016-08-03T19:02:07Z")

</div>

If you do not add to much apps and your host is not tooooo bad (use php7, gives you a great speed) then you not really need caching … Most shared hoster don’t offer but ask yours, maybe you get something, but often it doesn’t brings a big effect specially at shared hosting with one alone 😉  
Perfect is combination of redis & apcu

---

<div class="post-metadata">

**Author:** ![NickW](https://help.nextcloud.com/letter_avatar/nickw/32/6_449c533f586939b6e5f246632a46421f.png) [@NickW](https://help.nextcloud.com/u/NickW)\
**Post date:** [August 4, 2016, 7:46am UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/8 "2016-08-04T07:46:35Z")

</div>

> [@nickvergessen](#):
>
> The benefit of using arraycache is close to 0 thou

So why is it offered as an option?

> [@aLpHa](#):
>
> If you do not add to much apps and your host is not tooooo bad … then you not really need caching

You are probably right – most modern hosting will already have more optimisation than I can apply (especially given the limited admin access). So let’s allow the suppression of those warnings, if they serve no purpose and note in the documentation that they are not important.

> [@aLpHa](#):
>
> Perfect is combination of redis & apcu

If I wanted ‘perfect’, I wouldn’t be installing on shared hosting (the subject of this thread) … ‘working’ is fine. ‘Working without warnings’ would be better.

---

<div class="post-metadata">

**Author:** ![nickvergessen](https://help.nextcloud.com/user_avatar/help.nextcloud.com/nickvergessen/32/66965_2.png) [@nickvergessen](https://help.nextcloud.com/u/nickvergessen)\
**Post date:** [August 4, 2016, 7:56am UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/9 "2016-08-04T07:56:51Z")

</div>

> [@NickW](#):
>
> > The benefit of using arraycache is close to 0 thou
> 
> So why is it offered as an option?

Because it’s not of none benefit, but compared to real caching it’s like a 1-3% of the potential boost.

---

<div class="post-metadata">

**Author:** ![John](https://help.nextcloud.com/user_avatar/help.nextcloud.com/john/32/255_2.png) [@John](https://help.nextcloud.com/u/John)\
**Post date:** [August 4, 2016, 8:05am UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/10 "2016-08-04T08:05:56Z")

</div>

> [@NickW](#):
>
> ‘memcache.local’ =\> ‘\OC\Memcache\ArrayCache’,

Works for installations hosted at all-inkl as well.

And for the usefulness and benefit: at least it gets rid of the according warning on the admin page and, hence, stopped bothering me with it’s sheer existence 🕶

---

<div class="post-metadata">

**Author:** ![aLpHa](https://help.nextcloud.com/user_avatar/help.nextcloud.com/alpha/32/756_2.png) [@aLpHa](https://help.nextcloud.com/u/aLpHa)\
**Post date:** [August 4, 2016, 8:15am UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/11 "2016-08-04T08:15:58Z")

</div>

100% correct  
caching is just a optical performance feature - at the moment you get most out of the box with PHP7 as well a good service to the system environments - but to have best performance, you need a own server where you can set everything as you like.

Shared hosting is always something for low use and a little bit bad deal where you cannot expect to much

---

<div class="post-metadata">

**Author:** ![NickW](https://help.nextcloud.com/letter_avatar/nickw/32/6_449c533f586939b6e5f246632a46421f.png) [@NickW](https://help.nextcloud.com/u/NickW)\
**Post date:** [August 4, 2016, 8:26am UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/12 "2016-08-04T08:26:52Z")

</div>

@John: Exactly my point. Persistent warnings, habitually ignored, are never a good thing to encourage.

If I could just get rid of the `getenv("PATH")` warning – which I have no possibility of ever removing with configuration – I would be very pleased.

@nickvergessen: I could probably get 1-3% improvement by rebooting my router … 😉 [quote=“aLpHa, post:11, topic:2126”]  
Shared hosting is always something for low use and a little bit bad deal where you cannot expect to much  
[/quote]

I think we already know this, but it’s fine for many small businesses and private individuals. After all, people are running oC/NC on Raspberry Pis – convenience is sometimes more important than absolute performance. ‘Good enough’ is, well, good enough.

My point is that warnings are presented that we are teaching people to ignore.

---

<div class="post-metadata">

**Author:** ![mcnesium](https://help.nextcloud.com/user_avatar/help.nextcloud.com/mcnesium/32/42191_2.png) [@mcnesium](https://help.nextcloud.com/u/mcnesium)\
**Post date:** [October 25, 2019, 3:00pm UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/13 "2019-10-25T15:00:07Z")

</div>

> [@nickvergessen](#):
>
> The benefit of using arraycache is close to 0 thou 😉

It makes the warning go away 👍

---

<div class="post-metadata">

**Author:** ![TP75](https://help.nextcloud.com/user_avatar/help.nextcloud.com/tp75/32/12565_2.png) [@TP75](https://help.nextcloud.com/u/TP75)\
**Post date:** [October 25, 2019, 3:21pm UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/14 "2019-10-25T15:21:05Z")

</div>

For the benefit of the discussion and of the general public:

- [Server-Tuning 4: OPcache, APCu, memcache, memcached](https://timreeves.de/internet-technologie/server-tuning-4-opcache-apcu-memcache-memcached/)
- [Redis vs APCu 2018](https://www.it-cooking.com/technology/productivity/redis-vs-apcu-2018/)

Ref [NC 16 Docs » Nextcloud configuration » Memory caching](https://docs.nextcloud.com/server/16/admin_manual/configuration_server/caching_configuration.html)

> Nextcloud supports multiple memory caching backends, so you can choose the type of memcache that best fits your needs. The supported caching backends are:
> 
> - [APCu](https://pecl.php.net/package/APCu), APCu 4.0.6 and up required.  
> A local cache for systems.
> 
> - [Redis](http://redis.io/), PHP module 2.2.6 and up required.  
> For local and distributed caching as well as transactional file locking.
> 
> - [Memcached](http://www.memcached.org/)  
> For distributed caching.
> 
> Memcaches must be explicitly configured in Nextcloud by installing and enabling your desired cache, and then adding the appropriate entry to `config.php`  
> […]

> Note: […] Nextcloud supports only the **memcached** PHP module.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![roster-patrol0](https://help.nextcloud.com/letter_avatar/roster-patrol0/32/6_449c533f586939b6e5f246632a46421f.png) [@roster-patrol0](https://help.nextcloud.com/u/roster-patrol0)\
**Post date:** [February 6, 2024, 2:32am UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/15 "2024-02-06T02:32:19Z")

</div>

I activated memcache in the PHP configuration on my Hostinger panel and it worked!

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [November 6, 2024, 8:57pm UTC](https://help.nextcloud.com/t/memory-cache-for-shared-hosting/2126/16 "2024-11-06T20:57:25Z")

</div>


