There are 2 issues concerning the etag cache:
First, the etagsCacheMaxSize registration option is not compatible with once plugins, so the etagsCacheMaxSize needs to be moved somewhere else.
Second, since the removal of connections support means that multiple servers are likely to be created, the cache itself should be instantiated and used across multiple registrations.
The best solution I can seem to think of, is instantiating the plugin directly before registering it. Eg something like this:
const Hapi = require('hapi');
const Inert = require('inert');
const server1 = Hapi.server();
const server2 = Hapi.server();
const sharedInert = new Inert({ etagsCacheMaxSize: 500 });
server1.register(sharedInert);
server2.register(sharedInert);
@hueniverse Any thoughts on this?
There are 2 issues concerning the etag cache:
First, the
etagsCacheMaxSizeregistration option is not compatible withonceplugins, so theetagsCacheMaxSizeneeds to be moved somewhere else.Second, since the removal of connections support means that multiple servers are likely to be created, the cache itself should be instantiated and used across multiple registrations.
The best solution I can seem to think of, is instantiating the plugin directly before registering it. Eg something like this:
@hueniverse Any thoughts on this?