在前面的部分中,您已了解如何启用Portlet片段缓存。
In the previous sections, you learned how to enable portlet fragment caching.
选中用于启用Portlet片段缓存的复选框,如图1所示。
Select the check box for enabling portlet fragment caching as shown in Figure 1.
在命令提示符中,输入下列命令以启用Portlet片段缓存。
In the command prompt, you enter the following commands to enable portlet fragment caching.
此支持是Servlet片段缓存的扩展,具有一些额外的选项。
This support is an extension of the servlet fragment caching with a few additional options. Part 3.
此部分说明如何使用管理控制台或脚本编程接口来启用Portlet片段缓存。
This section shows how you can turn on portlet fragment caching using the administrative console or with the scripting interface.
片段缓存支持两种主要的缓存实例:对象缓存实例和Servlet缓存实例。
The fragment cache supports two primary types of cache instances: object cache instances and servlet cache instances.
可启用Portlet片段缓存的另一种方法是:通过使用脚本编程接口wsadmin。
Another way you can turn on portlet fragment caching is by using the scripting interface, wsadmin.
另一个性能改进是WebContentManagementportlet的内容现在可以被缓存到门户片段缓存中。
Another performance improvement is that the content of the Web content Management portlet can now be cached in the portal fragment cache.
为了启用子片段缓存,您可以将cachespec . xml中的属性consume -subfragments指定为true。
To enable subfragment caching, you can specify the property consume-subfragments in the cachespec.xml as true.
在这一部分中,我们将说明WebSpherePortal如何利用片段缓存来缓存单个Portlet片段(请参阅Portlet缓存示例应用程序)。
In this section, we will explain how WebSphere Portal exploits the fragment cache to cache individual portlet fragments (see Example application for portlet caching).
WebSphereApplicationServer还提供了一个缓存监视器企业应用程序 (CacheMonitor.ear),此应用程序在可视化片段缓存的内容方面非常有用。
WebSphere Application Server also provides also a cache monitor enterprise application (CacheMonitor.ear), which is very useful for visualizing the contents of the fragment cache.
您可以在两种环境中更精确地配置Portlet片段缓存,但是这些扩展是特定于门户的,并且在WebSpherePortal和WebSphere ApplicationServer中有所区别。
You can configure portlet fragment caching more precisely in both environments, but these extensions are portal specific and are different in WebSphere portal and WebSphere Application Server.
在应用程序的设计过程中,您通常会发现在不同的层内有很多高速缓存数据片段的机会。
During the design of an application, you can often identify many opportunities for caching fragments of data within the different layers.
通过为包括在页面中的组件标记片段指示恰当的生存期和缓存作用域,站点高度动态的部分将自动在页面中呈现。
Highly dynamic parts of the site will automatically be rendered in pages indicating lifetime and cache scope appropriate for the component markup fragments that are contained on those pages.
门户框架所面临的挑战是只缓存片段,而不缓存片段以外的构件上的任何依赖项。
The challenge for portal frameworks is to only cache the fragment without any dependencies on artifacts outside of the fragment.
出于测试的目的,本示例只使用其中的一部分列:url、片段、标题、缓存大小、相关信息、主机名和查询关键字本身。
This sample only USES a portion of them: URL, snippet, title, cached size, related information present, host name, and the query keyword itself for test purpose.
缓存:客户机能够缓存数据片段,比如员工的照片。
Caching: the client can cache pieces of data, such as the photo of the person.
这一点是通过对缓存片段而不是非缓存片段应用不同的URL生成机制实现的。
This is achieved by applying a different URL generation mechanism for cached fragments than for non-cached fragments.
很多情况下,利用servlet缓存来保存可以通过唯一的主键来识别的HTML片段,这个方法会处理得更好。
In many cases, this approach would be better handled using servlet cache to hold the HTML fragments that can be identified by unique keys.
利用Portlet缓存,门户会在响应请求前将缓存的Portlet片段聚合为完整的页。
With portlet caching, the portal aggregates cached portlet fragments into complete pages before responding to a request.
通过在其portlet . xml描述符(请参阅portlet描述符示例),portlet可以广告它们能够在片段中缓存。
Portlets can advertise their ability to be cached in the fragment cache by setting their expiry time in their portlet.xml.
Web服务器插件包含内置ESI处理器,该处理器将缓存整个页以及必要的片段,具有较高的缓存命中率。
The Web server plug-in contains a built-in ESI processor which caches whole pages, as well as fragments, providing a higher cache hit ratio.
expiration-cache元素指定了缓存将Portlet片段视为“新”的持续时间(以秒为单位)。
The expiration-cache element specifies the duration, in seconds, that a cache considers the portlet fragment to be "fresh".
这种情况下,Portlet根据缓存的数据呈现标记片段,而门户将标记聚合为完整的门户页。
In this case, the portlet renders the markup fragment based on the cached data, and the portal aggregates the markup into a complete portal page.
需要计算片段的缓存键,以确定是否向此键提供了Portlet的完整导航状态。
The cache key for the fragments needs to be computed such that the complete navigational state of the portlet contributes to this key.
添加EdgeCacheable属性到cachspec. xml文件中,如下所示,表示片段必须在Edge服务器上缓存。
Add the EdgeCacheable property to the cachspec.xml file, as shown below, to indicate the fragment has to be cached on the Edge server.
在我们的例子中,将使用Edge组件(通常安装在前线的Web服务器上)缓存内容(如图片和jsp页面)的片段。
In our example, we will cache fragments of the contents (such as images and JSPs) by the Edge component (typically installed on the front-line Web servers).
由于您只访问了一次Portlet,并且已具有一个“缓存未命中率”;因此,已在此时将片段填充到缓存,该缓存可以针对任何将来的请求提供服务。
Because you have accessed the portlet only once, you had a "cache miss"; therefore, the cache was then filled with the fragment and is ready to serve any future requests.
通常HTML片段或碎片可以作为从servlet或JSP输出的HTML片段被缓存。
Generic HTML snippets or fragments can be cached as HTML fragments that are output from a servlet or JSP.
缓存有效性——分析及报告片段和页面缓存。
Caching effectiveness - analysis and reporting on both fragment and page caching.
应用推荐