Setting up cache-control for error pages

101 views
Skip to first unread message

Dash Gir

unread,
Sep 22, 2021, 5:19:30 PM9/22/21
to WildFly
Using Wildfly 20. I have standard configuration for cache-control, XSS, CSS, Content-Type etc. using filter-ref under the undertow subsystem. When i use Chrome to inspect response header for known pages or paths everything works as expected.
However when i use an invalid resource for example https://ip:port/abcd, which throws a error 404 page not found, the response headers does not contain the cache-control setting. It has all the other filter-ref definition except for the cache-control. Looks like it is being dropped somewhere. Any ideas on how to add this to the error pages?

Here is how its setup:
<host name="default-host" alias="localhost">
       <filter-ref name="Cache-Control-header"/>
       ....
       ....
</host>
<filters>
       <response-header name="Cache-Control-header" header-name="cache-control" header-value="no-cache, no-store, must-revalidate"/>
       ....
       ....
</filters>

thanks
Reply all
Reply to author
Forward
0 new messages