3 ms·
I wonder if it would be possible to have page templates delivered separately from their dynamic content? The templating of the dynamic data would happen on the
by stcredzero 16y ago
I wonder if it would be possible to have page templates delivered separately from their dynamic content? The templating of the dynamic data would happen on the browser-side machine. This way, we could use really expensive compression algorithms with high CPU cost for compression, but then cache the compression result.
This could be achieved by using Javascript and fetching data as JSON, but it seems to be something that would be very useful and beneficial if it were standardized.
- pornel 16y agoThere is client-side XSLT already. The problem is that transformed template is usually same size or smaller than your source data. Really expensive algorithms aren't that much better to offset cost of sending template logic to the client. You could probably save some processing time by integrating compression directly into server-side templating - take advantage of the fact that some parts never change and keep them pre-compressed or at least cache some statistics about them to aid compression.
- jhy 16y agoThere is the SDCH spec: Shared Dictionary Compression over HTTP. Google Chrome uses it, and the Google Toolbar adds support to IE. The server supplies a pre-created dictionary (template) which gets cached, and further requests get a diff to that dictionary as a response. I've only found Google search using it on the server side, and the browser penetration is fairly low, but it seems promising. It makes requests very fast. I've also noticed that Google search serves image thumbnails as data:// URLs directly in the original response. They are going a long way to ensuring each page loads entirely in one request.