package votorola.a.web.wap; // Copyright 2012, Michael Allan. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Votorola Software"), to deal in the Votorola Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Votorola Software, and to permit persons to whom the Votorola Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Votorola Software. THE VOTOROLA SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE VOTOROLA SOFTWARE OR THE USE OR OTHER DEALINGS IN THE VOTOROLA SOFTWARE. import votorola.g.lang.*; /** A context for configuring the response headers for one or more calls. Configuration * should be done before writing to the response buffer because the response will be * committed (and its headers sent) on the first flush of the buffer. */ public @ThreadRestricted("Call constructor") interface ResponseConfiguration { // - R e s p o n s e - C o n f i g u r a t i o n -------------------------------------- /** Instructs the client to validate the response for every request, such that it * never uses a stale response without first asking the user's permission. Ensures * that Cache-Control must-revalidate * is added to the headers. */ public void headMustRevalidate(); /** Makes the response non-cacheable by the client. Ensures that * Cache-Control no-cache * (HTTP 1.1) and Pragma no-cache * (HTTP 1.0) are added to the headers. Also ensures that * Cache-Control no-store * is added for the sake of clients (Firefox 9) that disobey no-cache. * *

These nevertheless fail with Chrome 18. * Consider adding a nonce * to the client request as a fallback.

*/ public void headNoCache(); // Adding Cache-Control private [1] and Expires [2] does not help in Chrome 18. // [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1 // [2] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21 }