Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.1
-
Fix Version/s: None
-
Component/s: filtering
-
Labels:None
-
Patch Submitted:Yes
-
Number of attachments :
Description
It would be very nice to be able to filter all web resources in all kinds of ways (not just property substitution).
So I created a patch that allow you to filter resources bases on the extension (my purpose was to be able to remove unneeded chunks from PNG images to reduce their size, and to you YUI Compressor on css and javascript files). Here's a sample configuration for the patched plugin:
<configuration>
<userFilters>
<png>PNGFilter</png>
<css>cssCompressor</css>
<js>jsCompressor</js>
</userFilters>
</configuration>
I'm not fully satisfied with this patch because it does not let you configure the filters. I tried to instantiate filter objects from the configuration instead of using role-hints, but that did not seem to work.
Ideally, I would like to be able to write this:
<configuration>
<userFilters>
<png>
<PNGFilter>
<excludeChunks>
<excludeChunk>gAMA</excludeChunks>
<excludeChunk>iCCP</excludeChunks>
<excludeChunk>PRIVATE</excludeChunks>
</excludeChunks>
</PNGFilter>
</png>
<css>
<cssCompressor>
<breakPosition>80</breakPosition>
</cssCompressor>
</css>
<js>
<jsCompressor>
<breakPosition>-1</breakPosition>
<obfuscate>false</obfuscate>
</jsCompressor>
</js>
</userFilters>
</configuration>
Also, it may be better to attach filters to <webResource> in order to control more precisely which resources are filtered.
could it be possible to have a it test with your patch ?
Thanks