RewriteEngine on
SetOutputFilter DEFLATE
RewriteRule cache-([0-9]*).js$ all.php?version=$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !serve.php
RewriteCond %{REQUEST_URI} !cache-
RewriteCond %{REQUEST_URI} !all.php
RewriteRule (.*)$ serve.php?file=$1