【发布时间】:2016-06-09 05:57:07
【问题描述】:
如何将 hapi 中的缓存控制标头设置为 'no-cache'、'no-store'、'must-revalidate'?
在快递中,我能够做到以下几点:
res.header('Cache-Control', 'no-cache, no-store, must-revalidate');
我目前在 hapi 中有以下内容,但我认为它可能不正确:
function(request, reply){
var response = reply();
response.header('Cache-Control', 'no-cache');
response.header('Cache-Control', 'no-store');
response.header('Cache-Control', 'must-revalidate'
}
可以在hapi中做到这一点吗?
function(request, reply){
var response = reply();
response.header('Cache-Control', 'no-cache, no-store, must-revalidate');
}
【问题讨论】:
-
如何强制缓存某些文件?
标签: node.js caching express http-headers hapijs