Disabling cache in Curam
This is better than disabling the back button, even if it is one of the 10 ten web design mistakes. However, for Curam applications and most web applications, this is something that would really need to be done in order to ensure that the user gets the most current data when they look at a page and to satisfy the requirement of nothing persisted on the client machine.
Technical overview
There are two things that need to be done. The first is to add the following lines to the HTTP header:
Cache-Control: no-store
Pragma: no-cache
Expires: 0
And the following in the <head> block of your web page.
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
This will make most web browsers not cache the page.
The second thing you need to do is to work around the Internet Explorer bug which disregards the no-cache header information if your page is larger than 64k. To do that add
<head>
<meta http-equiv="Pragma" content="NO-CACHE" />
</head>
Near the end of your file.
Curam implementation
Unlike the process of disabling the back button, you cannot simply make the changes on gen-page-header.xsl or gen-page-footer.xsl. The changes need to be directly done on CuramCDEJ\lib\curam\xml\xsl\gen-jsp.xsl.
Note: If there are any upgrades to Curam, the changes need to be redone on the file.
In gen-page-header.xsl, add the following XML after the first instance of <head> in the jsp.xsl
<jsp:scriptlet>
response.setHeader("Cache-Control", "no-store");response.setHeader("Pragma", "no-cache");response.setHeader("Expires", "0");</jsp:scriptlet>
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
You also need to add the following XML after the scriptlet that outputs </body>:
<head>
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
</head>
Browser compatibility
This has only been tested on Firefox and Internet Explorer 6, but it should work with most browsers.

0 comments:
Post a Comment