Jump to content

Rudy

Members
  • Posts

    153
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Rudy

  1. Here is the customized module. You will need to run:

    composer require predis/predis

     to use it.

    Add the following settings to your `config.php`

        $config->redis_session_server_ip     = '127.0.0.1';
        $config->redis_session_server_port   = 6379;
        $config->redis_session_server_db     = 0;
        $config->redis_session_server_prefix = "PHPSESSID:";
        $config->redis_session_server_ttl    = 1800;

    Change the session prefix to whatever you want.

    Once installed, you can then share the same session (using the prefix) across multiple sites as long as those sites are reading/writing to the same redis server.

    SessionHandlerRedis.zip

    • Like 2
  2. The max number is relative to the size and availability of your database server. It also depends on how you set up your front-end output.

    For a short term solution, the first thing you need to do is to cache your front-end output as much as possible (without compromising the freshness of content of course). You can either use template caching or ProCache.

    Since you are on a shared host, you are at the mercy of the pool of sites/apps that are on the same vm. If you have the budget or want to have more control over how resources are being allocated, you might want to consider running your site on your own VPS. DigitalOcean, Linode, AWS to name a few. There are server provisioning management services out there that can help you with the set up. RunCloud, ServerPilot or Forge are some good examples.

     

    • Like 2
  3. This is how I would do it. Example in Twig, but you can see the logic in it.

    <ul>
        {% for child in pages.get(1).children() %}
            <li>
                <a href="{{ child.url }}">
                    {{ child.title }}
                </a>
                {% if child.numChildren(true) %}
                    <ul>
                        {% for gchild in child.children('YOUR CUSTOM SELECTOR HERE') %}
                            <li>
                                <a href="{{ gchild.url }}">
                                    {{ gchild.title }}
                                </a>
                            </li>
                        {% endfor %}
                    </ul>
                {% endif %}
            </li>
        {% endfor %}
    </ul>

     

×
×
  • Create New...