Saturday 16 October 2010 8:47:44 am
OK, I have investigated further. It seems like the browsers don't cache properly the JS and image files. So they are loaded again on loading of the page. An that's where the delay occurs. I have measured the loading of the subitems and inspected the traffic with Fiddler and here are the results:
Browser
|
Duration (first time)
|
Duration (second time)
|
Duration (after refresh)
|
Loading from cache
|
Firefox
|
8 sec
|
8 sec
|
8 sec
|
nothing
|
Safari
|
10 sec
|
10 sec
|
10 sec
|
nothing
|
Opera
|
7 sec
|
1 sec
|
7 sec
|
everything (JS, CSS, images)
|
Chrome
|
10 sec
|
4 sec
|
4 sec
|
only some JS files
|
Note that only Opera caches everything and works OK on next loading of the page.
I have measured the time from when the "Subitems" text is displayed, until the table with subitems is displayed. Here are the conditions for each test:
first time - all the cache cleared and page loaded
second time - typing the URL again in the address bar after first time
after refresh - hitting the browser's refresh button after the second time
I have checked out with Fiddler and all the static items (JS, CSS, images) have the cache headers properly set, so that they get cached: Last-Modified: Tue, 28 Dec 2010 08:57:40 GMT
Cache-Control: max-age=604800, must-revalidate
Expires: Mon, 15 Nov 2010 12:49:47 GMT
But as we can see the browsers still refuse to cache them. This is very strange because all my browsers are installed with the default installation and I didn't change their cache settings. Anybody has any clue what could be the problem? P.S. It seems to me that a lot of potential problems could come from this ajax approach of fetching subitems...
--
Nothing is impossible. Not if you can imagine it!
Hubert Farnsworth
|