Oleg Grenrus oleg.grenrus at iki.fi
Wed Mar 11 11:23:54 UTC 2020

Hi Michael,

thanks for the reply. In my blog I use mod_deflate (Transfer-Encoding:
gzip), and the result is

Uncompressed Page Size: 2392.6 KB
Compressed Page Size: 806.5 KB
Savings: 66.3%

(I tweaked parameters for dvisvgm, so uncompressed size went down too).

The overall gzipping is quite good and easy solution, basically adding

to .htaccess for Apache.

---

Good that you pointed out <g id="page1">; that id is unnecessary, and
I should strip it off. It does not add any value.

---

About saving images as external files, Hakyll does support such
functionality:

The latex-formulae-hakyll (and therefore latex-svg-hakyll) has internal
to do note to add support for storing files externally, which is doable
using Hakyll metacompilers.
One can name files using hash of their contents. That is a feature
waiting to be done.

---

I opened issues to remember these issues, but I cannot promise to work
on them (especially second one) any time soon.

Best regards,
Oleg Grenrus

On 11.3.2020 5.05, Michael Orlitzky wrote:
> On 3/6/20 7:41 AM, Oleg Grenrus wrote:
>> - One drawback is that result pages become bigger (and slower). For
>> example a formula-heavy
>> https://oleg.fi/gists/posts/2018-12-12-find-correct-laws.html is
>>
>>     - 576k in size with latex-formulae
>>     - 2819k in size with latex-svg (almost 5 times larger).
>>
>>   Rendering SVG images is also more CPU expensive.
>>
> I've been looking for a way to do away with MathJax for a while, and
> this is pretty cool. I know this is probably tricky to do in Hakyll, but
> you might be able to address the page-size issue by saving the SVG files
> externally and gzipping them. That would also get rid of some of the
> XHTML strict warnings (like the duplicate id="page1").
> _______________________________________________