I want to compress my html/js code when I get response from front controller in zend or before the content is sent to the client.
When I view this code in view source it shows all the code with spaces not like in Google.
is there a way to achieve this
You can create a plugin that runs during dispatchLoopShutdown from where you can get the body of the response, manipulate it and then set the body after minifying it.
Here is an example:
In your bootstrap you can register the plugin like