如何在 SharePoint Foundation 中启用输出缓存?
我正在使用 SharePoint Foundation 2010,并且希望为某些页面或整个网站启用输出缓存。在 SharePoint Server 上,您有一种机制可以跨网站集启用页面输出缓存(它实际上是底层的 ASP.NET 输出缓存)。在 SPF 上你无法获得这个功能——这很公平。
那么如何启用输出缓存呢?在 ASP.NET 中,我只需添加一个页面指令 - 类似于 <%@ OutputCache Duration="30" %>。如果该内容位于页面中,SharePoint 会引发错误。听起来好像需要在代码中完成,也许覆盖页面类?欢迎任何建议。
I am using SharePoint Foundation 2010 and would like to enable output caching for certain pages, or maybe the whole site. On SharePoint Server you have a mechanism to enable page output caching across the site collection (it is actually ASP.NET output cache under the hood). On SPF you don't get that feature - fair enough.
So how can I enable output caching? In ASP.NET I would just add a page directive - something like <%@ OutputCache Duration="30" %>. SharePoint throws an error if this is in the page. Sounds like it needs to be done in code, perhaps override the page class? Any suggestions welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要进入顶部网站集,您可以在网站管理下选择->网站集输出兑现->诸如现金档案之类的东西。在那里您可以设置输出兑现和其他内容的配置文件。
You need to go on top site collection, there you have option under site administration->site collection output cashing-> something like cash profiles. There you can set your profile for output cashing and other stuff.
您必须:
0 - 添加参数
1 - 扩展 SPHttpApplication、IVaryByCustomHandler。
2 - 修改您的 global.asax 后,
请参阅更多信息: https://msdn.microsoft.com/en-us/library/office/ms550239(v=office.14).aspx
You have to:
0 - Add the parameter
1 - Extend SPHttpApplication, IVaryByCustomHandler.
2 - After modify your global.asax,
See more in: https://msdn.microsoft.com/en-us/library/office/ms550239(v=office.14).aspx