清除果园CMS数据库缓存



我想直接将数据直接操作到数据库中。但是,这些变化未反映在果园网站上。在对数据库中进行一些数据更改后,如何告诉果园清除所有数据库缓存?

我假设您正在将记录添加到表LayerPartrecord?这是不起作用的,因为层是果园中的内容项目,它们是用桌子构建的,而不是层partrecord表。您将必须将记录添加到其他几个表中。它引出了一个问题,您为什么要这样做?果园不适合指导数据库修改。塞巴斯蒂安·罗斯(Sebastien Ros)在这里谈论果园的数据库结构,如果您真的有心修改数据库:http://sebastienros.com/understanding-orchard-s-database,但我肯定会说这比它比值得的。

相反,您可以使用果园命令行创建图层:

layer create Authenticated /LayerRule:"authenticated" /Description:"The widgets in this layer are displayed when the user is authenticated"

或使用导入/导出模块,因此您的导入代码看起来像这样:

<Layer Id="/Layer.LayerName=Authenticated" Status="Published">
  <CommonPart Owner="/User.UserName=admin" CreatedUtc="2014-07-01T12:22:26Z" PublishedUtc="2014-07-01T12:22:26Z" ModifiedUtc="2014-07-01T12:22:26Z"/>
  <LayerPart Name="Authenticated" Description="The widgets in this layer are displayed when the user is authenticated" LayerRule="authenticated"/>
</Layer>

您可以禁用SysCache模块,然后Orchard不会缓存数据库输出。否则,您只需重新启动您的网站,这也将清除数据库缓存。

还要确保您对数据库进行更改。例如,在您完全取消选择之前,WebMatrix不会保存行。

最新更新