Help needed in setting up Cache path in settings.php

Hi, I need some help in configuring the cache path in elgg-config/settings.php

I hope, I need to do it as follows - can anyone confirm please?

$CONFIG->simplecache_enabled = true;
$CONFIG->cacheroot = "DATA_PATH_SPECIFIED_DURING_INSTALLATION";
$CONFIG->assetroot = "WHERE_IS_THIS_ASSET_ROOT?"

Thank you

  • Thanks Nicolai.. I am confused on the assetroot folder. Cant find anysuch thing in the data directory. 

  • By default,

    
    assetroot == /path/to/dataroot/caches/views_simplecache/
  • Thank Nikolai. Let me try that.

  • Hi,

    When setting up any of $CONFIG->cacheroot, $CONFIG->localcacheroot or $CONFIG->assetroot, I end up with an error string instead of the elgg page.

    I symlinked webroot/cache to a directory on a tmpfs mounted partition to have more speed but that fails.

    Is there any working sample for how to configure these params ?

    TIA

  • These parameters are only important if you use multiple servers and want to store some of your data on other servers.
    If you've 1 server then ignore them.

    Better turn on OpCache, or setup Memcached/Redis.

    All our apps run on OpCache + nginx cache only, even without Memcached/Redis.

    As for symlinked, here's a simple example:

    Let's say the data directory aka $CONFIG->dataroot is located on this path:

    /var/www/elgg/data/

    And Elgg installed root aka  $CONFIG->wwwroot is located on:

    /var/www/elgg/www/

    Then symlink will be add with this command:

    cd /var/www/elgg/www/
    ln -s  /var/www/elgg/data/caches/views_simplecache/ cache

    That's all you need to know about caching.

    More details as always in the Elgg docs.

  • I have setup every possible cache as i'am running on my own budget an instance that i want to make public, on a hosted vps.

    Everything seems to work perfectly on apache, and at a certain point worked on nginx, but as i have made some optimisations x-sendfile for /cache/, cookie-less images, css, js, ... trying to achieve the best security and performance marks before communicating the url to the public, i think i have made some conflicting tweaks.

    I will continue investigating in that direction.

    By the way, what is the recommended/preferred web server for running elgg ? I have always setup apache as my webserver but i am starting to use more and more nginx as it seems to be faster and lighter on resources.

  • what is the recommended/preferred web server for running elgg ?

    I really don't understand why continue to use Apache if there're nginx?!

    There can be only one reason for this - the absence of nginx on shared hosting.

    BTW, using shared hosting for Elgg 3 is also bad idea.

  • I have root access on my vps, it's not a shared hosting config but a full system.

    The reason for using apache is that my background knowledge is on that server. Now, the possibilities for tweaking nginx for performance made it an attractive choice, but i am still facing some trouble to optimize it for elgg.

  • but i am still facing some trouble to optimize it for elgg.

    What are these troubles? 

    Set up basic optimization for your server. Don't try to over-optimize everything at once.

    Do it gradually and as needed. Test, test and test...

    Or do you have site like as Facebook/YouTube with traffic of a million users, lol ?

    Some details on this topic.