node.js - Set cache header in hapi -


how can set cache-control header in hapi 'no-cache', 'no-store', 'must-revalidate'?

in express able following: res.header('cache-control', 'no-cache, no-store, must-revalidate');

i have following in hapi think may incorrect:

function(request, reply){   var response = reply();   response.header('cache-control', 'no-cache');   response.header('cache-control', 'no-store');   response.header('cache-control', 'must-revalidate' } 

is possible in hapi?

function(request, reply){   var response = reply();   response.header('cache-control', 'no-cache, no-store, must-revalidate'); } 

yes, can it. string ('no-cache, no-store, must-revalidate') single value of header, set header. calling header() method on response object.

server.route({     method: 'get',     path: '/',     handler: function (request, reply) {          reply('ok').header('cache-control', 'no-cache, no-store, must-revalidate');     } }); 

Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -