Posts

Showing posts from May, 2015

Node JS - Redis All Page Caghing. XML return using redis hmset() and hgetall()

var full_url = req.protocol + '://' + req.get('host') + req.originalUrl; console.log("====== full_url : " , full_url); client.hgetall("full_url_hash", function (err, result_hash_object) { if ( result_hash_object != null && result_hash_object[full_url] != null && ( utils.undefined_check(result_hash_object ) != "" ) && ( utils.undefined_check( result_hash_object[full_url] ) != "" ) ){ console.log("full_url_hash vast cache find. Return xml page directly sending: " , full_url); res.set('Content-Type', 'text/xml'); res.send(result_hash_object[full_url] ); } else { //some workers and process and var hmset_url = client.hmset("full_url_hash", full_url, vast3_xml); if (hmset_url){ console.log("full_url