I am trying to pre-generate compressed brotli files in designated directories for static html, css and js files.
I found a rust tool here – https://github.com/neosmart/static-compress
Besides this, there’s also an option within the W3TC WordPress plugin. However, despite brotli PHP module being loaded and available, W3TC is not creating separate gzip or brotli files.
I used to have on-the-fly compression, but that option is no longer there.
I thought of creating a bash script and having it run every 6 hours or so, but then, I realized that it might not be as simple as it seems, as there are cases where the original file may change, and there might already be an .br file in the folder belonging to a previous version of the original file (source file) and so on.
Looks like there’s no other WordPress plugin than W3TC to do this either, and W3TC seems to be buggy on this aspect [I have enabled brotli compression in Browser Cache section and also enabled preload, but it's been 12 hours and not even a single cached file has a corresponding br or gz version in the servers cache directory].