Sometimes, however, you need to make sure the user is seeing the most up-to-date information. You must therefore disable client-side caching. WOApplication provides the setPageRefreshOnBacktrackEnabled: method for this purpose. In general, you send this message in the application object's initialization method:
// WebScript example - init { [super init]; [self setPageRefreshOnBacktrackEnabled:YES]; return self; }The setPageRefreshOnBacktrackEnabled: method adds a header to the HTTP response. This header sets the expiration date for an HTML page to the date and time of the creation of the page. Later, when the browser checks its cache for this page, it finds that the page is no longer valid and so refetches it by resubmitting the request URL to the WebObjects application.
A WebObjects application handles a page-refresh request differently than it would a standard request. When the application determines that the request URL is identical to one it has previously received (that is, the session and context IDs in the request URL are identical to those in a request it has previously received), it simply returns the response page that was associated with this earlier request. The first two steps of a normal request handling loop (value extraction from the request and action invocation) don't occur.
Table of Contents Next Section