XF 2.0 Best hook for html compressor

Marcus

Well-known member
What is the best hook for implementing a html / css compressor (removing white spaces etc, not gzip)? Is it the view or is there some other class in xf2?
 
Probably the templater_template_post_render code event with an event hint of public:PAGE_CONTAINER.

That will contain the final output of the page so you can modify it before it is returned.
 
Probably the templater_template_post_render code event with an event hint of public:PAGE_CONTAINER.

That will contain the final output of the page so you can modify it before it is returned.
Hmm ... this does not seem to be entirely correct, JS and CSS seems to be missing there (it does get added by \XF\Mvc\Renderer\Html).

I'd go for app_final_output
 
I missed the mention of CSS in the first post (no mention of JS either). Indeed that would likely be better to minify everything. At that point you can modify the entire response body.
 
Top Bottom