Compressing without mod_deflate

So, what do you do when you hosting company won’t allow you to use Apache’s mod_deflate?

I wanted to use PHP’s “auto_prepend_file” and php_value directive in .htaccess to automatically prepend a file, but my server evidently doesn’t support “php_value” directives.

method I found here which ________

Here’s what I came up with.

The first step was to tell the PHP engine to compress all PHP files.

php.ini:
zlib.output_compression=on
# let the server decide which level to use
zlib.output_compression_level=-1

auto_prepend_file=

Now, I had to make my static files PHP files. That was fine, but then it was returning the Content-Type as “”.

styles.css.php:
<?php
header (“Content-Type: text/css”);
?>

combined.js.php:
<?php
header (“Content-Type: application/x-javascript”);
?>

.htaccess:
# Check to see if the browser accepts gzipped files
RewriteCond %{HTTP:ACCEPT-ENCODING} ^.*gzip.*$
# Now, see if that file appended with “.php” exists.
RewriteCond %{REQUEST_FILENAME}.php -f
# If so, point to that file. (Don’t allow files that start with “.”.)
RewriteRule ^([^.]+.+) /home/path/public_html/$1.php [L]

Ellipsis

Unicode character 2026 – “Horizontal Ellipsis”

In Windows: Alt-0133

In Java: \u2026
Example:
String ellipsis = "\u2026";

In HTML: &#8230; or &#133; or &hellip;
Example:
… or … or …

In Javascript: \u2026
Example:
var ellipsis = "\u2026";
alert(ellipsis);

Ricola log: \u2026
Example:
Ricola.log.debug("\u2026")
will output 11:31:08 DEBUG - …

Ricola showPleaseWait: any of the HTML entities: &#8230; or &#133; or &hellip;
Example:
Ricola.page.showPleaseWait("Creating train documents&hellip;");