[
http://jira.magnolia-cms.com/browse/MAGNOLIA-2478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=22080#action_22080
]
Matteo Pelucco edited comment on MAGNOLIA-2478 at 4/2/09 3:19 PM:
------------------------------------------------------------------
Just to better explain my pdf.
On our project, we started to serve pages on public instances with server cache
disabled. Yes, we know the issues on that, but there have been so much trouble
here and initially our templates behaved in a strange ways with cache enabled.
Anyway, few days ago we have reintroduced server-side caching, with excellent
results (from 2 / 2.5 seconds per page --> to 100 ms), flush on every minute
(tested and working). Here all internal editors uses IE6.
>From that moment a lot of internal editors (we have more than 70) started to
>say: "Hey, why homepage is not up-to-date?" Only using CTRL + F5 (or emptying
>browser cache + restart of browser) solved that issue.
I started to work around HTTP Headers and I've found that with cache disabled
no caching info are sent to the browser and that forces IE6 to reload the fresh
content.
With browser cache enabled, right HTTP Headers are sent BUT IE6 caches all with
normal F5 or Refresh button, even after several days.
I've reproduced locally the issue and implemented another version of
setExpirationHeaders, taken from Magnolia 3.6.5, with these changes:
{code:java}
if (clientCacheResult == BrowserCachePolicyResult.NO_CACHE) {
// response.setHeader("Pragma", "no-cache");
// response.setHeader("Cache-Control", "no-cache, no-store,
must-revalidate, max-age=0");
// response.setDateHeader("Expires", 0L);
System.out.println("NO_CACHE, no headers sent");
} else {
final long maxAgeSeconds = (clientCacheResult.getExpirationDate() -
System.currentTimeMillis()) / 1000L;
response.setHeader("Pragma", "");
response.setHeader("Cache-Control", "max-age=" + maxAgeSeconds + ",
public");
response.setDateHeader("Expires",
clientCacheResult.getExpirationDate());
System.out.println("cached");
}
{code}
and doing that I managed to have IE6 working well, with server-side caching
enabled.
But as you may know, in this project there are a lot of problems... so I've not
found until now enough time to test this behaviour in dept.
That's it!
was (Author: matteo.pelucco):
Just to better explain my pdf.
On our project, we started to serve pages on public instances with server cache
disabled. Yes, we know the issues on that, but there have been so much trouble
here and initially our templates behaved in a strange ways with cache enabled.
Anyway, few days ago we have reintroduced server-side caching, with excellent
results (from 2 / 2.5 seconds per page --> to 100 ms), flush on every minute
(tested and working). Here all internal editors uses IE6.
>From that moment a lot of internal editors (we have more than 70) started to
>say: "Hey, why homepage is not up-to-date?" Only using CTRL + F5 (or emptying
>browser cache + restart of browser) solved that issue.
I started to work around HTTP Headers and I've found that with cache disabled
no caching info are sent to the browser and that forces IE6 to reload the fresh
content.
With browser cache enabled, right HTTP Headers are sent BUT IE6 caches all with
normal F5 or Refresh button, even after several days.
I've reproduced locally the issue and implemented another version of
setExpirationHeaders, taken from Magnolia 3.6.5, with these changes:
{code:java}
if (clientCacheResult == BrowserCachePolicyResult.NO_CACHE) {
// response.setHeader("Pragma", "no-cache");
// response.setHeader("Cache-Control", "no-cache, no-store,
must-revalidate, max-age=0");
// response.setHeader("Cache-Control", "no-cache, no-store,
must-revalidate");
// response.setDateHeader("Expires", 0L);
System.out.println("NO_CACHE, no headers sent");
} else {
final long maxAgeSeconds = (clientCacheResult.getExpirationDate() -
System.currentTimeMillis()) / 1000L;
response.setHeader("Pragma", "");
response.setHeader("Cache-Control", "max-age=" + maxAgeSeconds + ",
public");
response.setDateHeader("Expires",
clientCacheResult.getExpirationDate());
System.out.println("cached");
}
{code}
and doing that I managed to have IE6 working well, with server-side caching
enabled.
But as you may know, in this project there are a lot of problems... so I've not
found until now enough time to test this behaviour in dept.
That's it!
> SetExpirationHeaders fails to disable browser caching for Firefox 3
> -------------------------------------------------------------------
>
> Key: MAGNOLIA-2478
> URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-2478
> Project: Magnolia
> Issue Type: Bug
> Components: cache
> Affects Versions: 3.6.4
> Reporter: Philippe Marschall
> Assignee: Grégory Joseph
> Priority: Minor
> Fix For: 4.0, 3.6.4, 3.6.5
>
> Attachments: CacheHeadersFilter.patch, CACHING under Magnolia
> 3.6.3.pdf, SetExpirationHeaders.patch
>
>
> If we use the BrowserCachePolicy Never Firefox 3 still caches the page for a
> short amount of time. If we add "no-store" value for the Cache-Control header
> Firefox does no longer cache the page.
> Our code looks like this:
> {code}
> public void processCacheRequest(HttpServletRequest request,
> HttpServletResponse response,
> FilterChain chain,
> Cache cache,
> CachePolicyResult cachePolicyResult) throws IOException,
> ServletException {
> BrowserCachePolicy browserCachePolicy =
> this.getCacheConfiguration().getBrowserCachePolicy();
> BrowserCachePolicyResult clientCacheResult =
> browserCachePolicy.canCacheOnClient(cachePolicyResult);
> if (clientCacheResult.getExpirationDate() < 0) {
> response.setHeader("Pragma", "no-cache");
> response.setHeader("Cache-Control", "no-cache, no-store");
> response.setDateHeader("Expires", 0L);
> } else {
> final long maxAgeSeconds = (clientCacheResult.getExpirationDate() -
> System.currentTimeMillis()) / 1000;
> response.setHeader("Pragma", "");
> response.setHeader("Cache-Control", "max-age=" + maxAgeSeconds + ",
> public");
> response.setDateHeader("Expires",
> clientCacheResult.getExpirationDate());
> }
> }
> {code}
> We haven't yet tested with other browsers.
> There are some other issues we have with SetExpirationHeaders:
> * it tests for BrowserCachePolicyResult identity instead of using the return
> value of #getExpirationDate
> * it sets the Expires header twice, to two different values
> I'll attach a patch later this day.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------