node.js - Server-side response caching with Hapi -
i need cache idempotent requests in redis expiration time. tutorials featured on hapi's website favors catbox.
the tutorial recommends using server methods retrieving data. couldn't understand point of approach. need caching response data same url. what's point of creating new wrapper function?
also, i'm running server nginx reverse proxy. seems have response caching functionality, should use that, if should how i?
thank you.
i say, if possible nginx, , can figure out how it, use nginx. tends fast. but, harder task in nginx config files in javascript. it's hard me imagine need eek out bit of performance, redis fast. if me, use catbox redis.
if understand question, point of wrapper function deal creating key store , lookup cached value, , deal expiration.
if want, think this config file how nginx:
http { proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:10m inactive=24h max_size=1g; server { location / { proxy_pass http://1.2.3.4; proxy_set_header host $host; proxy_cache static; proxy_cache_valid 200 1d; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; } } }
Comments
Post a Comment