There are many JavaScript based minification tools, and this should be done once (basically as a compilation step in deployment). It should not have to be done per request. Perl can come in on the bundling and delivery of the minified JavaScript if you have various minified libraries that should be packed into the same request. I've seen this approach work quite successfully by presenting an endpoint that allows for a single request to contain a description of the desired JS library composition wanted; the request handler then slaps together all the requested minified JS sources into a single response. I didn't seem to find this modularized in CPAN, but it can be cobbled together relatively easily.