Suggestions on creating pre-compressed brotli files?

I am trying to generate pre-compressed brotli files in designated directories… Whatever html, css and js files are there have to be compressed to brotli.

I found a rust tool here – GitHub - neosmart/static-compress: A utility for creating a compressed copy of all files in a tree

Besides this, there’s also an option within W3TC Wordpress plugin. However, despite brotli PHP module being loaded and available, W3TC is not creating either gzip or brotli files.

On Nginx, I used to depend on on-the-fly compression using a module based on Google’s code.

Does anyone have any suggestions on what can be used to create pre-compressed brotli files? 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 plugin other than W3TC to do this either, and W3TC seems to be buggy on this aspect.

Has anyone taken a crack at this problem?

1 Like

I think people typically have their bundler (webpack for example) do the job with a plugin.

I was able to get get W3TC do the job in my case. Thanks.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.