Extension, Plugin

Archived
Forum
(read-only)

Minimee

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From John D. Wells

     

Don’t strip server-side includes when minifying HTML

Feature Request

JUK
JUK

I have HTML minification enabled and it works quite well (Minimee v.2.1.13).

But when I tried to use an SSI (server side include) it was stripped as well because its syntax is

<!--#include virtual="/another-file.shtml" --> 

and I assume Minimee interprets that as a comment.

Are you able to not strip out SSIs?

Thank you!

John D Wells
# 1
Developer
John D Wells

Hi,

The SSI is in fact an HTML comment, so the HTML minification library is going to strip them and there’s no option I have available to exclude it.  Minimee uses this library for all minification: https://github.com/mrclay/minify

I am curious to know how SSIs actually work in the context of an EE template.  I would assume that SSIs don’t work since it’s the EE template parser which renders the page, and not your server?

Cheers,
John

JUK
# 2
JUK

Hi John,
you are correct. I shot too fast. My apologies. Even if I turn all minification off and I can see the SSI include code, nothing is included.
I ended up using PHP’s file_get_contents function.

John D Wells
# 3
Developer
John D Wells

FYi You don’t need to use php just to include another template, ExpressionEngine has tags that can do that for you.

Cheers
John