[horde] Performance problems reloading the sidebar with HTTPS and IE
Jan Schneider
jan at horde.org
Tue Dec 6 02:14:40 PST 2005
Hi,
several people already experienced a strange performance problem with
Internet Explorer and HTTPS. At a certain point (as far as I found
out, as soon as the user clicks on a link that opens a second window,
e.g. the compose window), the refreshing sidebar menu didn't cache the
menu icons anymore.
The server returned 304s, but the browser trying to refetch the icons
on each reload still produced a lot of traffic, especially noteable on
slow connections. This is obviously a bug in Internet Explorer. I
tried hard to track this down and find a workaround, without success.
But the following seems to be a viable workaround. It also solves a
different problem, so I left the whole message intact:
======================================================================
After all the things we did on the server, we still had page loading
times of up to 2 minutes. All this time the browser blocked for any
actions. I figured then it should have something to do with all the 304
entrances in access log. All pictures were expired immediately in the
browsers cache, so it kept looking for changed versions. It was
especially annoying on the sidebar menu.
After a lot of Googling I fount there is a directive ExpiresActive for Apache.
I added this to the httpd.conf:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType text/css "access plus 1 days"
ExpiresByType application/x-javascript "access plus 1 days"
</IfModule>
Since then the sidebar loads in a flash on all browsers. In fact most
of the time you don't even see it flash, you simply see eventual
changes appear.
The only entrances in the access log left with status 304 were from the
mailbox page now.
The difference between the sidebar and the mailbox was the refresh
mechanism. So I started experimenting with common-header.inc from Imp.
I took out the meta-refresh and used Javascript to set window.location
to the refresh-url periodically.
I put this in <head>:
<script language="JavaScript">
<!--
function doLoad()
{
setTimeout( "refresh()", <?php echo $refresh_time ?> *1000 );
}
function refresh()
{
window.location = "/imp/mailbox.php?page=<?php echo $pageOb->page ?>";
}
//-->
</script>
And right under </head>:
<body onload="doLoad()">
What I did will for sure not be a beauty, but it works. All images,
style sheets and static Javascrips are now used from the browsers cache.
I can see in Munin that the Eth0 traffic is lower now and as I said the
browser is properly responsive now.
----- Ende der weitergeleiteten Nachricht -----
Jan.
--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
More information about the horde
mailing list