note
andreychek
There is actually already a module which does something like what you're looking for, called [HTML::Clean].<br><br>
There is one big difference between it, and the solution you are working on. Your solution modifies the files directly while still on your disk. It may make them hard to read when you need to maintain them, but no extra processing is required when a browser requests them.. so it may be a bit faster then the method the module uses.<br><br>
[HTML::Clean] will leave the code in your files in tact, and modifies the JavaScript code on the fly as the browser requests it. There may be a slight performance hit for this, but I don't really think your users will find it noticable.. but you should probably test that, and not take my word for it :-)<br><br>
I personally prefer using this module, as it makes code maintenance much easier. However, the best method definitely depends on the requirements of your project. If obfuscation of the source files on your disk is what you're looking for, this might not do the trick. This only "obfuscates" the code as users view it in their browsers. But if you use a regex to obfuscate your code, someone can just as easily use a regex to unobfuscate it :-) Good luck!<br>
-Eric
117150
117150