For reducing internet traffic and improving the GUI, client-side caching is the right idea, but using AJAX + HTML is not the best way for that.
To give a powerful approach for caching techniques, here are some ideas:
I - We need to replace HTML with a smarter XML-based presentation markup language. This new ML would have the following features:
1. Elements like:
This allow us to cache and refresh the ELEMENT element, the same way images are cached and refreshed by browsers. Our ELEMENT would be written in a separate file, and a web page would be a puzzle of separate files. This method may increase the number of HTTP requests for a web page download (a HTTP request for each separate file), but this would prevent re-loading the same ELEMENT element for another web page.
2. There could be a method to reduce the number of HTTP requests for web page downloads (which will be mentioned later in this message).
3. Our new ML code would also have elements like:
A HREF="..." TARGET="..."
This looks like HTML code, but the difference is that the TARGET attribute wouldn't contain values like "top" or "parent". It would rather contain a XPath expression (or a DOM path) which specify an element to be replaced, by the element which is specified by the URI of the HREF attribute. This method would be very useful, for example, for expanding/collapsing a tree item).
4. Our new ML could integrate both Swing-like components and HTML-like components in the same web page.
This way, Integrating JSF-like web frameworks with our caching approach also would be easier (since server-side and client side are both written in Java). Further more, developpers even wouldn't need to write twice the input validation code (one time for the server and another time for the client). The client would rather receive and cache a copy of the existing server-side pure Java validation code.
As for reducing the number of HTTP requests, imagine a web server which can send the web page with all its related files (like images) in only one server response, rather than waiting for the client to ask for these files. In addition, to download the web page, the request message would specify the already-cached componets not to be re-loaded. Then, We would also need a new tier beyond our old HTTP protocol.
<alem_info at yahoo dot fr>