The main advantage is having the full power of Tapestry and your services available to you. Can't speak for the performance, it might be faster with a filter before Tapestry, but I don't think it would impact your performance that much, we have multiple RequestFilters in our apps.
The configuration is an "OrderedConfiguration", so you can influence the order of the filters: conf.addInstance("my-security-headers", MySecurityHeadersRequestFilter.class, "before:StaticFiles"); The name of the contribution is defined here org.apache.tapestry5.modules.TapestryModule.class:862 You have access to the request and can add only the headers if needed, or just give the request to the next filter. Hope this helps! On Wed, Oct 3, 2018 at 8:00 PM Ajay Arora <toajayar...@gmail.com> wrote: > Thank you the quick response and solution. > > is this way of putting the headers gives us any advantages over having > filter in front of Tapestry filter like may be better performance ? > I believe the built-in Tapestry filters would be called before any custom > filter(s) and one of those filter like 'StaticFilesFilter' might skip some > requests going further to the new custom filter? And, I still needs to > parse the resource type in custom filter before setting a particular header > like x-frame-options does not make sense a image? > > Thanks for your help ! > > Ben -- Netzgut GmbH