Under the Hood: The Search Web Part

                 

 
Special Edition Using Microsoft SharePoint Portal Server
By Robert Ferguson

Table of Contents
Chapter 14.  Customizing Dashboards


Full-Page Caching

The caching of the Dashboard Definitions Catalog is a first step in optimizing your portal's performance that was introduced with Service Pack 1. All Web Parts of a dashboard with this caching enabled will still be executed, while this often may not be necessary. Instead, the HTML output generated from the assembly of all Web Parts of a dashboard can be cached for all users. This is known as full-page caching, a new feature added in Service Pack 1.

Full-page caching will look at the caching options for each Web Part of the dashboard. If "All User " caching is not enabled for all Web Parts (except for the Search Web Part), full-page caching does not work.

Let's examine that "except for the Search Web Part" a little further for those of you who are already familiar with Web Part development. The Search Web Part illustrates well how Web Part developers can determine the caching behavior of their Web Part at runtime.

The Search Web Part is implemented in a Visual Basic Script function called getContent, which is called by the dashboard factory to retrieve the XML or HTML output. The getContent function takes a single parameter, which is an XML Node object that contains all the Web Part property information, including the caching behavior properties. If just the simple search dialog is shown, full-page caching is allowed regardless of the actual cache settings.

If the advanced search dialog is shown, caching is not applied, such that the more frequently used simple version remains cached. To override the full-page cache, which typically would occur if a request with the same dashboard URL is made, a NoFullPageCache=1 flag will be passed with the request to render the dashboard. This allows Web Part developers to bypass the cache under certain circumstances, while the benefit of caching in common circumstances remains.

When the cache time-out has not been exceeded, SharePoint Portal Server will use the cached version generated from an earlier request. The cache " expires " based on the cache settings of the individual Web Parts in that folder. As one would expect, the time-out is set to the minimum value of all the cache time-outs of the individual Web Parts. So, for example, if there are four Web Parts that are configured with time-out values of 300, 500, 800, and 1000 seconds, the page will be cached for 300 seconds.

The use of full-page caching prevents some Web Parts from functioning according to their design, because any server-side script is only called once, on the first request, during the caching period. Content that is based on user credentials will not get updated accordingly ; the content remains static.

For a portal home page, such static pages may be desirable, but in many cases you will require more flexible content. This can be accomplished using

  • Isolated Web Parts , which instantiate an iFrame, an embedded instance of the browser within the current browser window. The iFrame's src property determines which content is to be shown. Pointing to an Active Server Pages (ASP) page, this page can then generate dynamic content. The Web Part itself is now static HTML, basically just an iFrame that can be cached across all users. An example of this method of dynamic content is the new Subscription Summary (iFrame) Web Part.

  • Dynamic HTML (DHTML), which allows returning static content that will be interpreted by the client to generate a dynamic user interface. For example, DHTML allows you to return a list of information that gets formatted according to client settings, through the browser's built-in Document Object Model.

Enable Full-Page Caching

To enable full-page caching, one must set a property on the digital dashboard folder. In addition to this property, all Web Parts on the dashboard must allow for caching across all users to let full-page caching actually occur. Typically, this means that all the Web Parts have set their caching behavior property to All Users, as discussed earlier in this chapter. The Search Web Part is an exception to that rule.

CAUTION

If you change the Search Web Part's caching behavior property, clicking the Advanced Search link will not show the advanced search dialog. Keep the default setting of no caching.


To enable or disable the dashboard caching, do the following:

  1. Log in as Workspace Coordinator on the server hosting the workspace.

  2. Click Start, select Programs, select Accessories, and then click Command Prompt.

  3. Navigate to the SharePoint Portal Server\Bin directory, which by default is C:\Program Files\SharePoint Portal Server\Bin.

  4. To Enable caching for the root digital dashboard, type

      cscript portalperf.vbs http://<server >/<workspace >/portal dashboarddef fullpage  

    To enable caching for a sub-dashboard, type

      cscript portalperf.vbs http://<server >/<workspace >/portal/<sub-dashboard> fullpage graphics/ccc.gif enable  

    To disable dashboard definition caching, replace the word enable with disable in the previous command line.

  5. In your browser, open http://<server>/<workspace>/Dashboards/Management, and then click Flush application level cache.

A New Subscription Summary Web Part

Subscriptions are user specific, and therefore it is not possible to cache the default Subscription Summary Web Part that you will find on the main dashboard across all users. For this reason, Microsoft has provided an updated version of this Web Part called " Subscription Summary (iFrame) " with Service Pack 1. This Web Part is available from the Support\Tools directory on the SharePoint Portal Server 2001 SP 1 CD, or by download. This Web Part is designed to replace the existing Subscription Summary Web Part that you find on the home page of the dashboard. The new version can be used regardless of the cache settings applied to the page.

To replace the Web Part, do the following:

  1. Log in as Workspace Coordinator.

  2. Open Internet Explorer and type the URL http://<server>/<workspace> in the address bar.

  3. If any of the Service Pack 1 dashboard performance optimizations have been applied, click on the icon with the four little squares next to the Help link in the top right corner.

  4. Click the Content link in the top of the dashboard.

  5. In Web Parts, select the Subscription Summary Web Part.

  6. On the General Settings page for the Web Part, click Delete.

  7. Click OK to confirm the deletion.

  8. Back on the Content page, click Import a Web Part File, in the Import or Create section.

  9. Navigate to the location of IFSubSum.dwp in the support\tools directory.

  10. Select IFSubSum.dwp, and then click Open.

  11. We need to edit this Web Part slightly; therefore, select the new Subscription Summary (iFrame) Web Part.

  12. On the Settings for "Subscription Summary (iFrame)" page, click Show Advanced Settings.

  13. Under Get content from the following link, replace " workspacename" with the name of your workspace.

  14. Click Save to leave the Settings page.

  15. Click Save to leave the Content page.

Because this Web Part is running as an isolated Web Part, it will not know if you have selected another style sheet file name to reflect your company's look and feel. This problem is common to all isolated Web Parts. The Subscription Summary (iFrame) Web Part illustrates how this problem can be addressed: In the URL that is defined under Get content from the following link, the css=spsdash.css query parameter refers to the actual style sheet used. Change this if necessary to the appropriate style sheet file name.


                 
Top


Special Edition Using Microsoft SharePoint Portal Server
Special Edition Using Microsoft SharePoint Portal Server
ISBN: 0789725703
EAN: 2147483647
Year: 2002
Pages: 286

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net