Save time and bandwidth by caching your read requests.
Estimated Setup Time: 5 minutes
docker run -i -t -e "MONGOHQ_URL=mongodb://<user>:<pass>@<host>:<port>/<db>" -p 45000:5000 cameron/keen-cacheKeen.configure(...);
Keen.client.keenUrl = 'http://<DOCKER_HOST>:4500';
If you have the MonogHQ addon enabled, your MONGOHQ_URL environment variable will be populated automatically.
To restrict clients from hitting Keen directly, generate API keys that only work on the proxy:
require('crypto').randomBytes(16).toString('hex');package.json, use Keen.encryptScopedKey(proxyMasterKey, {'allowedOperations': ['read']})allowedOperations in the Keen.encryptScopedKey options object to further restrict the proxy-only keyKEEN_MASTER_KEY and KEEN_PROXY_MASTER_KEY when running the node process
docker run -e "KEEN_MASTER_KEY=..." -e "KEEN_PROXY_MASTER_KEY=..." ....env.sampleSeting the ALLOWED_DOMAINS environment variable to a JSON array of hosts (['proto://hostname[:port]',...]) will restrict access to those domains via the Access-Control-Allow-Origin header.
Cache expiry (10 minutes) is handled by MongoDB's expireAfterSeconds feature on the cachedAt index. If you change the timeout, delete the index and restart the app (the index will be re-created automatically).
Content type
Image
Digest
sha256:3e01d391b…
Size
212.6 MB
Last updated
about 11 years ago
docker pull cameron/keen-cache