|
 |
pro_jsp thread: Browser Caching and Frames
Message #1 by "Berry, Thomas" <TBerry@V...> on Mon, 3 Jun 2002 08:48:48 -0400
|
|
I think what is happening is that the browser is retrieving the frame-page
(and not the JSP displayed inside it) from its cache, causing the entire
no-cache mechanism (which works fine otherwise) to be overriden.
You could try making the frameset itself a JSP and setting the no-cache
directives in that as well to check this out.
The problems with caching and frames was one of the reasons the entire
concept of framesets was removed from the XHTML 1.0 specification (which is
the current HTML version recommended by the W3C). While it takes a bit more
effort to create a consistent look and feel while not using frames
(especially if you want to prevent menustructures, logos, etc. from being
duplicated across lots of pages) it is worth it in the end.
For my own projects I've moved towards an XML/XSL solution where XSL
fragments can be used to store common page elements which are then combined
using in other XSL files together with XML dat a for the dynamic content.
The HTML page is then created on the server before being streamed to the
client. Using JSP includes something similar can be achieved, loading the
common elements into the JSP on the fly during generation of the output
(myself, I use a complex of servlets and Javabeans instead. As all HTML code
has been moved to the XSL I have little use for JSPs right now, maybe XSP
might be something to look at though).
I've also found that there is a negative attitude towards frames in many
companies because of the potential security risk they pose (crooks loading
your pages into their own frames allowing them to snoop information from the
cookies etc.). Using non-framed pages alleviates those concerns.
Jeroen T. Wenting
jwenting@h...
Murphy was wrong, things that can't go wrong will anyway
> -----Original Message-----
> From: Raoul van Balen [mailto:raoul.van.balen@a...]
> Sent: Friday, June 07, 2002 09:39
> To: Pro_JavaServer_Pages
> Subject: [pro_jsp] Re: Browser Caching and Frames
>
>
> I've got a similar problem with caching using frames in the jsp's.
> Everytime i change something in a jsp, rebuild it and check out the
> results, i always get the cached page in return!
>
> I've tried using the following lines both at the top and the bottom of
> every jsp:
>
> <%
> response.setHeader("Cache-Control","no-store");
> response.setHeader("Pragma","no-cache");
> response.setDateHeader ("Expires", 0);
> %>
>
> I use JBuilder 5 with Tomcat 3.2 on a Win95 platform.
>
> Maybe you have some other suggestions?
>
> many thanx, Raoul.
|
|
 |