This removes a round-trip, although it's probably slightly less bandwidth-efficient
and definitely more complex. You'll need to make Varnish rewrite / to /index-inline.html
and send it to the backend. It doesn't work on the .dev version, unfortunately.
<!-- replace <link rel="shortcut icon" href="data:image/png;base64,[base64;favicon.ico]" type="image/png"> -->
<!-- end replace -->
- <!-- replace <script>[js/remoteglot.min.js]</script> -->
+ <!-- replace <script>/*REPLACE:inlinejson*/[js/remoteglot.min.js]</script> -->
<script type="text/javascript" src="js/chessboard-0.3.0.js"></script>
<script type="text/javascript" src="js/chess.js"></script>
<script type="text/javascript" src="js/json_delta.js"></script>
document.getElementById("board").addEventListener('mousedown', mousedownSquare);
document.getElementById("board").addEventListener('mouseup', mouseupSquare);
+ if (window['inline_json']) {
+ let j = window['inline_json'];
+ process_update_response(j['data'], { 'get': (h) => j['headers'][h] });
+ delete window['inline_json'];
+ }
request_update();
window.addEventListener('resize', function() {
board.resize();