About Results Caching Plug-ins

                                                                                                                                                                                                                                                                                                                                      Back to [Book]     [Topic]

About Results Caching Plug-ins

A results caching plug-in can generate a page for a request in three parts:

  • A header, such as a page banner, which changes for every request
  • A body, which changes less frequently
  • A footer, which also changes for every request

Without this feature, a plug-in would have to generate the whole page for every request unless an IFRAME is used, where the header or footer is sent in the first response along with an IFRAME pointing to the body. In this case, the browser must send another request for the IFRAME.

If the body of a page has not changed, the plug-in needs to generate only the header and footer and to call the dr_net_write function instead of net_write with the following arguments:

  • Header
  • Footer
  • Handle to cache
  • Key to identify the cached object

The Web Server constructs the whole page by fetching the body from the cache. If the cache has expired, the Web Server calls the refresh function and sends the refreshed page back to the client.

An Init SAF that is visible to the plug-in creates the handle to the cache. The Init SAF must pass the following parameters to the dr_cache_init function:

  • RefreshFunctionPointer
  • FreeFunctionPointer
  • KeyComparatorFunctionPtr
  • RefreshInterval

The RefreshInterval value must be a PRIntervalTime type. For more information, see the NSPR reference at http://www.mozilla.org/projects/nspr/reference/html/index.html.

As an alternative, if the body is a file that is present in a directory within the web server system machine, the plug-in can generate the header and footer and call the fc_net_write function along with the file name.

This chapter lists the most important functions that a results caching plug-in can use. For more information, see the install-dir/include/drnsapi.h file.

Labels

sunjava sunjava Delete
webserver70 webserver70 Delete
guide guide Delete
webtier webtier Delete
system system Delete
application application Delete
webserver webserver Delete
sun sun Delete
server server Delete
java java Delete
developersguide developersguide Delete
web web Delete
developers developers Delete
nsapiguide nsapiguide Delete
nsapidevelopersguide nsapidevelopersguide Delete
nsapi nsapi Delete
+nsapiguide +nsapiguide Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact