CubicWeb清漆助手
cubicweb-varnish的Python项目详细描述
摘要
此多维数据集支持cubicweb网站的清除机制,即 坐在一个清漆储藏室后面。
内部构件
清除机制包括向 清漆的管理后端(默认情况下 本地主机:6082)。一般建议对此进行保护 具有机密文件的管理端口,可以在 立方体。以这种方式可以在 分布式设置。
开箱即用,此多维数据集不会清除任何URL。其逻辑 应该“清除”的页面必须在内容多维数据集中实现。
要配置要清除的url,必须实现 IVarnishAdapter,例如
.. sourcecode:: python
from cubes.varnish.entities import IVarnishAdapter
- class BlogEntryVarnishAdapter(IVarnishAdapter):
__select__ = is_instance(‘BlogEntry’)
- def urls_to_purge(self):
- return (‘/’, #frontpage
- self.entity.absolute_url(), #URL of blog post ‘/BlogEntry’ # list of blog entries)
调试:CubicWeb Varnish无法连接到时不会崩溃 管理端口,它将在日志中静默记录错误。