【问题标题】:cache-control headers on openshiftopenshift 上的缓存控制标头
【发布时间】:2015-04-26 18:58:28
【问题描述】:

如何在 openshift apache 服务器上设置缓存控制标头?我使用 python 2.7 墨盒(带有 wsgi 和 django),我找不到如何修改 apache 设置。感谢您的帮助!

【问题讨论】:

    标签: python apache openshift wsgi


    【解决方案1】:

    您必须使用 .htaccess 在 OpenShift 上设置缓存控制标头。有关示例缓存控制代码,请参阅 using cache in .htaccess to speed up your site。有关在 OpenShift Python 应用程序存储库中使用 .htaccess 的示例,请查看using basic auth with Python

    【讨论】:

    • 感谢您的帮助,但我无法以这种方式进行设置。我将一个 .htaccess 文件放入我的 repo 根目录(在 wsgi.py、setup.py 旁边),它没有任何影响。我的 .htaccess 内容是: Header set Cache-Control "max-age=2592000, public, must-revalidate"
    • .htaccess 文件可能应该放在您的wsgiwsgi/projectname 目录中。
    猜你喜欢
    • 2011-01-13
    • 2010-10-31
    • 2017-01-10
    • 1970-01-01
    • 2011-10-28
    • 2020-07-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多