I don't like Java. I like Simon's Asciimation.
so... I told Simon I'd have a look at rewriting the engine in some language I like, possibly using AJAX
I'll use PHP as he needs to host on KiwiWebHost which doesn't do Python so well
The main issue is the size of the data file which is currently 1.9M
Here's some options I've come up with
AJAX ... open a XMLHTTP connection and pass the frames from the server down it
- AJAX
- problem: how to compress the frames?
in JavaScript? too CPU intensive, not what JavaScript is good for
- modern browsers support compressed web pages, but does this apply to AJAX? prob not, but this suggests the next option
Compressed web pages ... by using a compressed web page we should get at least as good performance as with Java
options:
Apache: mod_deflate, mod_gzip.... don't know if available on KiwiWebHost?
- PHP: ob_gzhandler
- Note: You cannot use both ob_gzhandler() and zlib.output_compression. Also note that using zlib.output_compression is preferred over ob_gzhandler().
- PHP: zlib.output_compression.... preferred
http://pt.php.net/manual/en/ref.zlib.php#ini.zlib.output-compression
must be set in php.ini though
.... maybe .htacess would work? ... using ob_gzhandler for now
- prob: "All versions of MSIE have a bug where they don't cache gzipd contents. If your application depends on caching, this is something to keep in mind" --- is it true??
From http://www.whatsmyip.org/mod_gzip_test
{{{http://software.gen.nz/asciimation/a4.php is gzipped
- Original Size: 1914 K Gzipped Size: 79 K Data Savings: 95.87% }}}
Finished result: http://www.linuxsoftware.co.nz/asciimation
