Score:2

Ways to make deployment ready pre-compressed brotli files on windows server

in flag

I am dynamically generating HTML files, which I use for deployment.

This is what I use to make these HTML file:

function writeFile()
    Dim objStream
    Set objStream = CreateObject("ADODB.Stream")
    objStream.CharSet = "utf-8"
    objStream.Open
    objStream.WriteText content
    objStream.SaveToFile absoluteFileLocationAndName, 2
    Set objStream = Nothing
end function

What are my options to obtain, in addition, a pre-compressed version?

I am not sure if I need to go as far as implementing https://github.com/AnderssonPeter/CompressedStaticFiles ... but it would bring the benefit of adding CSS, and JS file compression. Side Note: for CSS and JS compression I plan on using Notepad++ run program on save to automatically minify and then compress minified file.

Similar post Tool to create pre-compressed [Brotli] files

As an alternative I found PeaZip which allows brotli compression on files, but would need to find a way to integrate that.

I am using MirrorFolder Cloud Edition to deploy my files, FTP synchronized in real-time. MirrorFolder allows for pre- and post commands to be run during execute. I suppose at that point I could have PeaZip run a script to create a pre-compressed brotli version of the file.

Thank you for your suggestions and ideas on any other tools I could use to do this.

djdomi avatar
za flag
Requests for product, service, or learning material recommendations are off-topic because they attract low quality, opinionated and spam answers, and the answers become obsolete quickly. Instead, describe the business problem you are working on, the research you have done, and the steps taken so far to solve it.
MeSo2 avatar
in flag
@djdomi I appreciate your reminder of the policy. I will do my best to stay _on topic_ and will add to my question as I go. Right now I am working on trying to get PeaZip to produce `.br` files when I make `HTML` files.
MeSo2 avatar
in flag
@djdomi I reworded my question a bit, and got it working.
Score:1
in flag

I was able to use PeaZip to make pre-compresses Brotli files:

function make_Brotli_version(absoluteFileLocationAndName)
    dim command, shell
    command = "%comspec% /c " & _
        " ""C:\Program Files\PeaZip\res\bin\brotli\brotli.exe"" -9 " & _
        absoluteFileLocationAndName & " -o " & absoluteFileLocationAndName & ".br"
    Set shell = Server.CreateObject("WScript.Shell")
    shell.exec command
    set shell = nothing
end function

Here (trying to be helpfull) I am going to expand a bit outside of the scope of my question ... because if you are after this answer, you maybe also after how I got to minify my HTML files.

A Free HTML delinting on Windows 10 can be a challenging undertaking.

I discovered https://github.com/kangax/html-minifier and it is working nicely. Being on a Window OS, it was a bit tricky to get it all working, here a link to my post https://github.com/kangax/html-minifier/issues/1143 as I was working things out. Nonetheless, all is good! The way I got the callback to work is to code around it; by verifying if the file has a newer DateCreated (or DateLastAccessed) using asp. (To minify JS files I ended up using google-closure-compiler.)

And for CSS, JS, and HTML files, I now have my Notepad++ delinter set up, so with a save it automatically makes these additional files.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.