3 Replies Latest reply on Jan 12, 2015 10:24 AM by Chuan Guo

    How to configure the HTTP Cache-Control for static files?

    Chuan Guo Newbie

      Hi,

       

      I'm new with JBoss/Wildfly, could be a stupid question, but I've searched in web, but still no answer...

       

      I have a project, ServerSide is JEE & Wildfly (src/java/) and front end is html + javascript (src/webapp/),

      I would like to configure the HTTP Header's Cache-Control for static files like html file,

      like ETAG or maxAge, to avoid Refresh everywhere after a new version..

       

      I know in Java I can add Cache-Control to Response's header, but it seems that

      they only work for Request to Java, but not for static files.

       

      How can I configure this for them? or simply in global?

       

      I've also tried to insert Filter in subsystem for undertow:

        <response-header name="Cache-Control" header-name="Cache-Control" header-value="no-cache"/>

      then inserted a the following for default-host in <server>

        <filter-ref name="Cache-Control"/>

      but it also only works for dynamic part....

       

      Thanks in advance!

      Michael