Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
HAWKULAR-784 use content-type parsing rather than path name suffixes.
Browse files Browse the repository at this point in the history
compress json and html in addition to js and css
  • Loading branch information
jmazzitelli committed Feb 1, 2016
1 parent 70ade56 commit b1afa9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dist/src/main/resources/standalone.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
<xsl:template match="undertow:subsystem/undertow:server/undertow:host">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
<filter-ref name="gzipFilter" predicate="path-suffix['.css'] or path-suffix['.js']"/>
<filter-ref name="gzipFilter" predicate="regex[pattern=&apos;(?:application/javascript|text/css|text/html|application/json)(;.*)?&apos;, value=%{{o,Content-Type}}, full-match=true]"/>

This comment has been minimized.

Copy link
@mtho11

mtho11 Feb 1, 2016

Member

Readability in the first version was much better :-p

This comment has been minimized.

Copy link
@jmazzitelli

jmazzitelli Feb 1, 2016

Author Contributor

I only used the suggested code from the link you provided in the JIRA description :-p
This compresses the content even if the path doesn't end with .js or .css or .html or .json (and in the case of JSON, there is no .json suffix - but content-type of application/json is what we'd normally want to look for).

</xsl:copy>
</xsl:template>

Expand Down

1 comment on commit b1afa9d

@mtho11
Copy link
Member

@mtho11 mtho11 commented on b1afa9d Feb 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to test this with curl or whatever just make sure to set on the
Requests Headers: Accept-Encoding:gzip, deflate
and you should receive back in the
Response headers: Content-Encoding: gzip

Please sign in to comment.