【问题标题】:How to use Twisted Web static.File resource without cache?如何在没有缓存的情况下使用 Twisted Web static.File 资源?
【发布时间】:2011-08-05 03:23:33
【问题描述】:

我将 Twisted Web static.File 资源用于 Web 服务器的静态部分。

对于开发,我希望能够添加新文件或修改当前的静态文件,而无需重新启动 Twisted Web 服务器。

我在 getChild 方法中查看 static.File 的源代码,但看不到资源是如何缓存的: http://twistedmatrix.com/trac/browser/tags/releases/twisted-11.0.0/twisted/web/static.py#L280

据我了解,getChild 方法在每次调用时都会返回一个新资源。 非常感谢创建非缓存静态文件资源的任何帮助。

非常感谢, 阿迪

【问题讨论】:

    标签: twisted twisted.web


    【解决方案1】:

    twisted.web.static.File 直接从文件系统提供服务。它没有缓存。不过,您的网络浏览器可能有缓存。

    【讨论】:

    • 非常感谢您的确认。我发现问题出在我身上。我只是看错了文件夹。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多