Hapi.js - Question about the architecture for caching

24 Views Asked by At

so from what i understand, when i empty that name field on the cache array of option dicts, then the engine will automatically use this default cacher for anything? like for any responses from any plugin and route thats below this server container


'use strict';

const Hapi = require('@hapi/hapi');
const CatboxRedis = require('@hapi/catbox-redis');

const server = Hapi.server({
    port: 8000,
    cache: [
        {
            name: 'my_cache',
            provider: {
                constructor: CatboxRedis,
                options: {
                    partition : 'my_cached_data',
                    host: 'redis-cluster.domain.com',
                    port: 6379,
                    database: 0,
                    tls: {}
                }
            }
        }
    ]
});

Did not test as i do not have a locally installed redis server

0

There are 0 best solutions below