I've toyed with the idea that can build a dictionary based on HTML
templates.
Using PHP templates, can get PHP to compile them for SDCH, and put any
static HTML into the dictionary.
So a PHP template something like...
<html xmlns="
http://www.w3.org/1999/xhtml" xml:lang="<?php $text
('lang'); ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title><?php $text('title'); ?></title>
<style type="text/css">
body { font-family: "Bitstream Vera Sans", sans-serif; font-size:
1.2em; }
table { border-collapse: collapse; }
th { background: #ddd; }
th, td { border: 1px solid #bbb; padding: 0 0.5em; }
</style>
</head>
<body>
<h1><?php $text('title'); ?></h1>
<h2><?php $dateTime($_SERVER['REQUEST_TIME']); ?></h2>
<table>
<thead>
<tr><th></th><th><?php $_('Name'); ?></th><th><?php $_('Price'); ?
></th><th><?php $_('Percent');?></tr>
</thead>
<tbody>
<?php foreach($data['rows'] as $i => $row) { ?>
<tr class="<?php if ($i & 1) { ?>odd<?php } else {?>even<?php }?
>">
<td><?php $ordinal($i + 1); ?></td>
<td><?php $escape($row['name']); ?></td>
<td><?php $currency($row['price']); ?></td>
<td><?php $percent($row['percent']); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<p>
<?php if ($data['previous']) { ?>
<a href=""><?php $_('prevn', $data['pageSize']); ?></a>
<?php }
if ($data['next']) { ?>
<a href=""><?php $_('nextn', $data['pageSize']); ?></a>
<?php } ?>
</p>
<p>
<a href="index.php">en</a>
<a href="index.php?lang=fr_FR&tz=Europe/Paris">fr_FR</a>
<a href="index.php?lang=fr_CA&tz=America/Blanc-Sablon">fr_CA</
a>
</p>
</body>
</html>
Gets compiled down to...
<?php /* SDCH compiled version of sdch\templates\template.php */
$encoder->copy(0, 53);$text('lang'); $encoder->copy(53, 91);$text
('title'); $encoder->copy(144, 12);$encoder->copy(156, 260);$text
('title'); $encoder->copy(416, 13);$dateTime($_SERVER
['REQUEST_TIME']); $encoder->copy(429, 49);$_('Name'); $encoder->copy
(478, 9);$_('Price'); $encoder->copy(487, 9);$_('Percent');$encoder-
>copy(496, 32);foreach($data['rows'] as $i => $row) { $encoder->copy
(528, 15);if ($i & 1) { ?>odd<?php } else {$encoder->copy(543, 4);}
$encoder->copy(547, 12);$ordinal($i + 1); $encoder->copy(559, 15);
$escape($row['name']); $encoder->copy(574, 15);$currency($row
['price']); $encoder->copy(589, 15);$percent($row['percent']);
$encoder->copy(604, 19);} $encoder->copy(623, 33);if ($data
['previous']) { $encoder->copy(656, 15);$_('prevn', $data
['pageSize']); $encoder->copy(671, 8);}
if ($data['next']) { $encoder->copy(679, 15);$_('nextn', $data
['pageSize']); $encoder->copy(694, 8);} $encoder->copy(702, 202);
So if the UserAgent supports SDCH and has the required dictionary, can
execute the SDCH version of the template, if not use the regular PHP.