How to minimize cached HTML branch templates and inline CSS, JS code in symfony2?

I am using symfony 2.3 and I want to serve miniature HTML and inline CSS and JS.

I know that there are some packages that do this, but it minimizes all things on the fly using the onKernelResponse event listener, I tried "MatTheCat / HtmlCompressorBundle", but after checking the server response time, ask for the total time and memory usage after using I found that these performance indicators were the worst.

I think the best way to accomplish this task is to perform the minify operation when compiling twig files so that it is minimized only in the production environment.

I already use assetic bundle to minimize js and css files.

How can I complete this task?

+4
source share
1 answer
-1
source

Source: https://habr.com/ru/post/1617643/


All Articles