| No it won't. There's lots of problems with doing that. 1) you need to -at least- check the disk for updates. On linux, you need to update access time. This will take time. In memory has no such obligations. 2) you still need to compress the file in memory. You can cache the result of the compression, but that won't buy you much. Specifically it'll be too large to ... see point 3. 3) Because in practice pages are generated from very little data (the template is -way- shorter than the filled in sent out text), the ability to work with the data in little pieces without allocating large buffers in memory will avoid trampling the cache, which is going to get you an insurmountable advantage. And this is ignoring the elephants in the room: 1) Because it's a static file, you'll have to send more data to the client side in total to achieve the same result (e.g. look at how GWT does it, and even there). 2) Because you still want to show customers "their" page, you'll need several more roundtrips to achieve the same with javascript that you wouldn't need with server pages (Note how one of the GWT pagespeed optimizations is to dynamically generate the page initialization data using the webserver to avoid an initial roundtrip). 3) Pure static files lose you a lot of features. Comments, scores, ... none of that. That may or may not be acceptable. |
2) It might not buy you much (I disagree), but is hardly a disadvantage over any other approach where you'd want to send compressed http responses.
3) Let me get this straight; you're talking about the CPU data cache? It's not going to be the bottleneck in a scenario where you are basically pumping data into a socket. If it was, how would allocating a lot small buffers have an advantage over a single large allocation, if the data was the same in the end?
As for elephants...
1) It depends on the expected result. A page built on static files doesn't need to be static in any other sense.
2) I'm not sure why you think that dynamically generated "server pages" are different from static ones in this case. The GWT pagespeed optimizations you are talking about are not relevant to the discussion, since they are not inherent to either static/dynamic backends.
3) As far as I'm concerned, this is the only valid point you have brought to the discussion.