Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/json keyvalue cache #311

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

Conversation

bugalot
Copy link
Contributor

@bugalot bugalot commented Mar 1, 2017

FULL PR SET IS
#311
oat-sa/tao-core#1212
oat-sa/extension-tao-outcome#65
oat-sa/extension-tao-outcomeui#92

This PR enables the KeyValueCache to use Redis as its storage. Without this, we are not able to share the generis cache efficiently amongst servers, which is a show stopper for the TAO Cloud. Indeed, as funcAcls, roles, ... are depending on the cache, it seems obvious it has to be shared amongst web servers to provide large-scale authoring platforms (a.k.a. backoffice).

This is amazing how your TAO platform will be more reactive than ever, especially when entering the Item Authoring or taking a Delivery.

I'm aware that it might not work with all projects (ACT ?), but with TAO Vanilla it does pretty well! However, it's a config to change so no impact is expected. I will dig further on every project to see how feasible it is to go to KeyValueCache using Redis for customer projects.

In order to enable the KeyValueCache in redis:

  1. Change your config/generis/cache.conf.php file to
<?php
return new common_cache_KeyValueCache(array(
    'persistence' => 'cache',
    'jsonify' => true
));
  1. Change your config/generis/persistences.conf.php file to
<?php
return new common_persistence_Manager(array(
    'persistences' => array(
        'cache' => array(
            'driver' => 'phpredis',
            'host' => '127.0.0.1',
            'port' => 6379
        ),
        'default' => array(
            'driver' => 'pdo_pgsql',
            'host' => 'localhost',
            'dbname' => 'taoplatform300',
            'user' => 'taopostgres',
            'password' => '******'
        ),
        'serviceState' => array(
            'driver' => 'phpfile'
        )
    )
));

Copy link
Contributor

@antoinerobin antoinerobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we have something that automatically jsonify the cache when it is a redis cache in order to avoid mistakes ?

@siwane siwane removed their request for review July 1, 2020 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants