keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

Minification can break some javascripts #325

Open orlitzky opened 1 year ago

orlitzky commented 1 year ago

With javascript minification enabled, the slider on the homepage of https://www.txindependencehealthplan.com/ no longer works.

I've taken a look at the code, and I don't really think this can be fixed easily. In this one instance, sure -- maybe. But the root of the issue is that regular expressions can't reliably parse html and javascript. (See e.g. https://stackoverflow.com/questions/6751105/why-its-not-possible-to-use-regex-to-parse-html-xml-a-formal-explanation-in-la for an explanation).

Would you be open to a warning on the settings page saying that the feature uses a regex heuristic and can affect the behavior of the site in some cases?