[ng-dhtml] putting the build tool thing to bed

Mark D. Anderson mda at discerning.com
Wed Sep 29 19:06:14 CDT 2004


> So I'm going to leave the webapp performance tuning and metrics 
> tutorial to MDA.

MDA is a little busy right now, but briefly....

You have to distinguish a bunch of factors/circumstances:
1. first visit to a page (nothing in browser cache).
2. later visit to a page.
3. use of the "refresh" button.
4. use of "defer".
5. script vs. img vs. xmlhttp.
6. browser cache settings.
7. use of http 1.0 vs. 1.1 keepalive vs. 1.1 pipelining.
8. cache control headers.
9. whether the scripts are from the same server, and whether
   that server is the same as a bunch of images on the page.

Out of the box, in its default configuration, IE violates standards
concerning cache validation. It has some sort of mysto-spooko
set of heuristics. You can force it to obey standards via some
stuff in "Advanced Settings". It will validate upon "Refresh".
Every other modern browser obeys cache standards.

Because script elements must be executed serially (unlike
images), for simplicity of implementation, all browsers i've
experimented with do cache validation and loading of scripts
in series also (that is, the pool of connections are not
leveraged, although the pool may interfere if it is busy
with images).

If you are using Last-Modified/If-Modified-Since (which is
what happens by default if you are serving disk files directly
over any web server), then Gecko and other non-IE browsers
will be do an If-Modified-Since conditional GET on every
script, in series, every time the page is loaded.
It isn't pretty.

One workaround, which is the simplest, is combine them
into a single js file. Another is to hook your web server
to not use Last-Modified but instead say Expires a year later,
and then append a strong validator after "?" in the src url.

Anyhow, has this discussion really devolved to the point of
debating whether we have to forego any ability to use 
transforms of the files under source control, at run time?

-mda



More information about the NG-DHTML mailing list