Response filter execution order not per doc

Enonic version: 6.5.4
OS: Mac and linux


The doc states: “The filters with a lower order will be executed first. In case there are several filters with the same order number, the position of the applications (as configured for a Site in Content Studio) determines the order of execution.”

The favicon app has a filter with order 10.

So I made a filter with order 11 in our “main” app.

Even though its order has a higher number its gets run before the favicon one :frowning:

So I tried putting the favicon app first in site, but that did not help :frowning:

Do I need to do some change to the site page and publish for the order to take effect?

Changing the page and publish did not help.

I made a test using the favicon app and one app with 2 filters with orders 5 and 15. It seems to work correctly for me.

How do you see that your filter is ran before the favicon one?

Try logging the response received in your filter handler.

exports.responseFilter = function (req, res) {"Response received: " + JSON.stringify(res, null, 4));

If favicon is executed before, you will see the page contributions added to headEnd before your filter is executed.
Also check that the favicon app is configured with an icon in the site.

Ah I need a filter to run after headEnd is applied… I guess thats not currently possible?

That is currently not possible. Page contributions are applied after all the filters are executed.
But a filter can add or remove page contributions from the response it receives.

1 Like