SailsJs:部署后获得“304 not modified”页面

问题描述 投票:0回答:2

我正在尝试更新我的SailsJs应用程序来修复我正在使用Heroku的空白页面,但是我没有从浏览器修改状态304。

enter image description here

我想我做了我需要修复我的应用程序上的空白页所需的一切,但我不知道为什么页面没有在Heroku上更新

我的Procfile:

web: node app.js

如果有人可以提供帮助我感激

谢谢!

node.js heroku sails.js
2个回答
0
投票

我认为你不需要修理任何东西。如果您尝试使用POSTMAN或其他浏览器调用相同的URL,则应获得状态200。


0
投票

您可以将其添加到策略中,然后将其应用于您想要的特定页面/请求 - 如果您不想为整个应用程序设置此项。

/API/policies/no cache.就是:

    /**
     * Sets no-cache header in response.
     */
    module.exports = function (req, res, next) {
        sails.log.info("Applying disable cache policy");
        res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');
        res.header('Expires', '-1');
        res.header('Pragma', 'no-cache');  
        next();
    };

不要忘记将nocatche包含在config / policy.js中

'*': 'nocatche'
© www.soinside.com 2019 - 2024. All rights reserved.