I'm looking to make all of my pages such that the browser never caches them.
I'd like to do this in a single place, so that each page does not have to
include the correct code on its own (too easy to forget a page).

Due to browser and proxy server bugs, embedding meta-tags into the pages
themselves is not reliable. Traditionally, the way you do this is to add the
following code somewhere:

   response.setHeader("Cache-Control", "no-cache");
   response.setHeader("Pragma", "no-cache");
   response.setHeader("Expires", <some time>);

The logical place for this is the location through which all requests come:
the doGet method of the main servlet. Assuming this, the proper thing to do
in Turbine (I think) would be to declare a servlet like so:

public class MyServlet extends org.apache.turbine.Turbine
{
    public void doGet(HttpServletRequest req, HttpServletResponse res)
        throws IOException, ServletException
    {
        res.setHeader("Cache-Control", "no-cache");
        res.setHeader("Pragma", "no-cache");
        res.setHeader("Expires", <some time>);
          super.doGet(req,res);
    }
}

The problem is that this doesn't work. The Turbine servlet is declared as
final, so cannot be subclassed.

So, how have people handled this problem? Does Turbine have some other way
to keep pages un-cached?

Wordman

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to