ugly idea to rewrite html to contain font-face and load a page (much) faster
commandline.be
18 November 2018, 12:19
Hi,
I am trying to squeeze as much performance out of a cheap VSP hosting as possible. To this end I'm using Google PageSpeed Insights to further optimize loading performance. I wrote a real simple directoryID to make sure content is cached for 1 week(s)
As a first phase i'm simply serving static HTML with CSS and images. Because i seek to use JavaScript only sparsely.
Now i noticed loading a Google font by means of a stylesheet causes a notable reduction in load times. For Mobile i'm at 1 second and for desktop at 0.7 seconds which meets my mark for such content. This from original load times of 1.6-2.3 seconds.
To this end i seek to load the below into every HTML page for a specific website/virtualhost, this as part of an inline <STYLE> declaration in the HTML header.
@font-face { font-family: 'Roboto Mono'; font-display: auto; src: url('fonts/robotmonoreg.woff2') format('woff2'); }
I thought to do this using the URLToolkit, but then again this does not seem to be the right way of doing so.
As i'm somewhat time restricted i hoped this can be answered in this forum.
Thank you for your consideration.
ps: I'm also looking for people who want to help design a Single Board Computer, i'm a fool with an idea but i have zero experience designing hardware from scratch. Help is welcome. https://github.com/commandline-be/sbcboards/wiki/Redoxo-:-redox-os-sbc (not necessarilty redox-os specific by the way)
commandline.be
18 November 2018, 12:36
This is the google pagespeed index i'm using, should this be of any use to anyone. https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fcommandline.be%2F&tab=desktop
commandline.be
20 November 2018, 11:42
uhm, nobody cares for an ugly idea or the description is actually the solution ?
Hugo Leisink
22 November 2018, 16:05
From my point of view, loading from the same server is faster, as the browser does not need to setup an extra connection.
commandline.be
23 November 2018, 16:57
well, to my amazement, according to Google insight, it is not. For some reason it takes an extraordinary amount of time (+200ms)
Though at this time the page starts to load at 0.3 seconds and completes at 0.8 seconds the time spent loading the fonts is +200ms at times.
I'm interested to learn if i can further improve on response times and font loading but thus far i'm kind of at the edge of what this VPS can do (ARM chip + 200 mbps + NAT + FW ) Since a single page takes <= 1000ms i'm happy as this was the design goal for static pages on this VPS.
This topic has been closed.