With the rise of interest in brotli, and the absence of deflate in our
'default content', it seems reasonable that we would pre-compress
both gz and br compressed flavors of our .html pages.

Because of our use of typemaps, this becomes dirt simple stupid.
We could do something similar for our .css and .js, however we
would need to add these to the list of typemap file types (as with
our .html files), and move the original contents (as with .html.en
for what would have become .html), perhaps .css.plain / .js.plain.

Attached is a patch which adds the alternative .html encodings for
mod_negotiate to sift through, when processing the user-agent's
preferred mime delivery.

What is needed is the logic for ant to invoke these commands to
build the target content.html.lang files;
gzip -k -n -9 {name}
bro[tli] --input {name} --output {name}.br --quality 11

(At brotli quality 9 the regen is substantially faster with a nominal
loss of compression. In any case it's for the benefit of www.a.o so
I don't mind if the rebuild takes just a bit more time. Q11 stretches
out the cost of a complete make all regeneration by 5 minutes.)
Index: style/xsl/typemap.xsl
===================================================================
--- style/xsl/typemap.xsl       (revision 1791799)
+++ style/xsl/typemap.xsl       (working copy)
@@ -71,10 +71,42 @@
 <xsl:value-of select="$design[translate(@lang, $uppercase, $lowercase)
                               = $lang]/@lang" />&lf;
 
-<xsl:text>Content-type: text/html; charset=</xsl:text>
+<xsl:text>Content-Type: text/html; charset=</xsl:text>
 <xsl:value-of select="$design[translate(@lang, $uppercase, $lowercase)
+                              = $lang]/@charset" />&lf;&lf;
+
+<xsl:text>URI: </xsl:text>
+<xsl:value-of select="/metafile/basename" />
+<xsl:value-of select="$design[translate(@lang, $uppercase, $lowercase)
+                              = $lang]" />
+<xsl:text>.gz</xsl:text>&lf;
+
+<xsl:text>Content-Language: </xsl:text>
+<xsl:value-of select="$design[translate(@lang, $uppercase, $lowercase)
+                              = $lang]/@lang" />&lf;
+
+<xsl:text>Content-Type: text/html; charset=</xsl:text>
+<xsl:value-of select="$design[translate(@lang, $uppercase, $lowercase)
                               = $lang]/@charset" />&lf;
 
+<xsl:text>Content-Encoding: gzip</xsl:text>&lf;&lf;
+
+<xsl:text>URI: </xsl:text>
+<xsl:value-of select="/metafile/basename" />
+<xsl:value-of select="$design[translate(@lang, $uppercase, $lowercase)
+                              = $lang]" />
+<xsl:text>.br</xsl:text>&lf;
+
+<xsl:text>Content-Language: </xsl:text>
+<xsl:value-of select="$design[translate(@lang, $uppercase, $lowercase)
+                              = $lang]/@lang" />&lf;
+
+<xsl:text>Content-Type: text/html; charset=</xsl:text>
+<xsl:value-of select="$design[translate(@lang, $uppercase, $lowercase)
+                              = $lang]/@charset" />&lf;
+
+<xsl:text>Content-Encoding: br</xsl:text>&lf;
+
 <xsl:if test="position() != last()">&lf;</xsl:if>
 </xsl:template>
 <!-- /variant -->
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscr...@httpd.apache.org
For additional commands, e-mail: docs-h...@httpd.apache.org

Reply via email to