Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

minify html pages

Avatar

Level 4

Is it possible to minify html pages generated from AEM 5.6.1 ?

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi,

I would talk to your WEB server team about the options available with your web server.

If you are using JSP's you can also use <@page trimwhitespaceDirectives = true >

[1] Should also help you

Regards,

Opkar

[1] http://www.wemblog.com/2014/07/how-to-remove-white-space-from.html

View solution in original post

3 Replies

Avatar

Employee

Hi,

[1] contains a presentation on optimizing sites with CQ5.

From [2], a page about scaling CQ5:

  • Use the web server to deflate responses to the client (e.g. Apache's mod_deflate) 

You can enable minification of client libraries from the OSGI console[3[4]

Regards,

Opkar

[1] http://www.slideshare.net/GabrielWalt/optimizing-cq5wem-html5-sites

[2] https://docs.adobe.com/docs/en/cq/5-6-1/deploying/scaling.html

[3] http://therealcq.blogspot.de/2012/10/the-fine-art-of-minification-in-cq55.html

[4] http://aem.matelli.org/client-library-configuration-minify-and-debug/

Avatar

Level 4

Thanks for sharing the details.

Will it meet following requirement

  • Compacting(removing spaces) HTML code, including any inline JavaScript and CSS contained in it, can save many bytes of data and speed up downloading, parsing, and execution time

For Example : view-source:http://sports.ndtv.com/cricket/news/107423-pakistan-splits-champions-trophy-preparatory-camp

Avatar

Correct answer by
Employee

Hi,

I would talk to your WEB server team about the options available with your web server.

If you are using JSP's you can also use <@page trimwhitespaceDirectives = true >

[1] Should also help you

Regards,

Opkar

[1] http://www.wemblog.com/2014/07/how-to-remove-white-space-from.html