Open RChutchev opened 1 month ago
Package ver. 3.3.4
We've required this package because Cloudflare Auto Minify is deprecated and will be removed according to the CF announcement.
Also, a good idea to add this regex to remove / Comments like this /
'/\/\*.*?\*\//' => "",
@dipeshsukhia, could you please participate?
Hi, we discovered a problem with minification. We've string like "Hello (or hi), world" in
tag, and after minification output looks like "Hello (or hi),world". Looks like that's a bug and I can't fix that by adding an extra exclude regex in config, I can exclude routes only.
I think this one regex causes this. //remove new-line after JS's line end (only most obvious and safe cases) '/),[\r\n\t ]+/s' => '),',
I bypassed this by adding @excludeMinify and @endExcludeMinify, but that's adding and comments to production. If we add this to all user inputs, that will cost us hundreds of megabytes of traffic per month (comment size multiplied by inputs multiplied by users count multiplied by pageviews (at least: 57 bytes 15 user's input fields (maybe more, the maximum is about 1000) about at least 100.000 page views (for all users) by month (real count can be times more) = about 85.5mb for absolutely unnecessary for users data, maximum up to 57 GB per month).
Is it possible to add some additional configs like disabling some minifications and adding custom minifications or modify the regex to add space after '),' like this '), ' (simple way), or ignore values from some HTML tags like
<h1-6>
<p>
<span>
<title>
<meta>
(like og:description) etc, which can contain the user's input, because in our case all is affected (I think best of the best but hard to implement)What do you think about this?