[
https://jira.jboss.org/jira/browse/RF-7452?page=com.atlassian.jira.plugin...
]
Richard Kennard commented on RF-7452:
-------------------------------------
Nick,
My apologies. The problem is a little different from what I described. I attach an example
application to demonstrate. Deploy the example WAR to Tomcat (or JBoss), and use the
Firefox 'Live HTTP Headers' plugin
(
https://addons.mozilla.org/en-US/firefox/addon/3829) or something similar to hit this
URL...
http://localhost:8080/addressbook-faces/a4j/g/3_3_1.GAorg/richfaces/rende...
...you will see the headers include (upon the first refresh)...
HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
Pragma: No-cache
Cache-Control: max-age=86400
...and (upon subsequent refreshes)...
HTTP/1.x 304 Not Modified
Server: Apache-Coyote/1.1
Pragma: No-cache
The presence of 'Pragma: No-cache' defeats the browser caching under Firefox.
Interestingly, it is related to this section in the web.xml...
<security-constraint>
<web-resource-collection>
<web-resource-name>unrestricted</web-resource-name>
<url-pattern>/a4j/*</url-pattern>
</web-resource-collection>
</security-constraint>
...if you remove this section the 'Pragma: no-cache' goes away and the caching
works fine. You can hit...
http://localhost:8080/addressbook-faces/a4j/g/3_3_1.GAorg/richfaces/rende...
...and it works great.
Is there some strange interaction between RichFaces caching and security-constraints?
org.ajax4jsf.DEFAULT_EXPIRE needs to override 'Pragma'
header
-------------------------------------------------------------
Key: RF-7452
URL:
https://jira.jboss.org/jira/browse/RF-7452
Project: RichFaces
Issue Type: Bug
Components: browser compatibility
Affects Versions: 3.3.1
Reporter: Richard Kennard
Assignee: Nick Belaevski
Fix For: 3.3.2.CR1
Attachments: addressbook-faces.war
The flag org.ajax4jsf.DEFAULT_EXPIRE, which defaults to 86400, is meant to set
client-side expiry for static resources (see RF-2506 and RF-4212). This is a great idea
but it is incorrectly implemented.
The problem is browsers differ on what they consider as the 'expires header'. For
correct operation, a combination of 'Pragma', 'Cache-Control' and
'Expires' is needed. At the moment the code is setting 'Pragma: No-cache',
which means expiry does not work on Firefox. If you use Firebug, you can see all the
resources are reloaded every page.
This is what RichFaces currently sets as its headers, by default:
Pragma: No-cache
Cache-Control: max-age=86400
Expires: Fri, 26 Jun 2009 22:32:50 GMT
This is what it should set:
Pragma:
Cache-Control: max-age=86400
Expires: Fri, 26 Jun 2009 22:32:50 GMT
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira